Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync rustc_codegen_cranelift #105713

Merged
merged 101 commits into from
Dec 15, 2022
Merged

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Dec 14, 2022

This time there are a bunch of bugfixes, some new llvm intrinsic implementations and refactorings to the build system in preparation for running cg_clif tests as part of ./x.py test.

r? @ghost

@rustbot label +A-codegen +A-cranelift +T-compiler

bors and others added 30 commits October 8, 2022 08:53
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
This removes the rayon dependency that requires the previous update to
Cranelift 0.89.0 to be reverted.
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (rust-lang#102318).
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with.
That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-codegen Area: Code generation A-cranelift Things relevant to the [future] cranelift backend labels Dec 14, 2022
@rustbot rustbot added the A-testsuite Area: The testsuite used to check the correctness of rustc label Dec 14, 2022
@bjorn3
Copy link
Member Author

bjorn3 commented Dec 14, 2022

@bors r+ subtree sync

@bors
Copy link
Contributor

bors commented Dec 14, 2022

📌 Commit 13e33c0 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2022
@matthiaskrgr
Copy link
Member

@bors p=1 subtree sync

@bors
Copy link
Contributor

bors commented Dec 15, 2022

⌛ Testing commit 13e33c0 with merge d67000e...

@bors
Copy link
Contributor

bors commented Dec 15, 2022

☀️ Test successful - checks-actions
Approved by: bjorn3
Pushing d67000e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 15, 2022
@bors bors merged commit d67000e into rust-lang:master Dec 15, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 15, 2022
@bjorn3 bjorn3 deleted the sync_cg_clif-2022-12-14 branch December 15, 2022 10:18
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d67000e): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-cranelift Things relevant to the [future] cranelift backend A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.