Skip to content

Subtree sync for rustc_codegen_cranelift #132526

New issue

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

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

Already on GitHub? # to your account

Merged
merged 55 commits into from
Nov 3, 2024

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Nov 2, 2024

The highlight this time is an update to Cranelift 0.113,

r? @ghost

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

bjorn3 and others added 30 commits September 23, 2024 11:20
- fix for divergence
- fix error message
- fix another cranelift test
- fix some cranelift things
- don't set the NORETURN option for naked asm
- fix use of naked_asm! in doc comment
- fix use of naked_asm! in run-make test
- use `span_bug` in unreachable branch
Add intrinsics `fmuladd{f16,f32,f64,f128}`. This computes `(a * b) +
c`, to be fused if the code generator determines that (i) the target
instruction set has support for a fused operation, and (ii) that the
fused operation is more efficient than the equivalent, separate pair
of `mul` and `add` instructions.

https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic

MIRI support is included for f32 and f64.

The codegen_cranelift uses the `fma` function from libc, which is a
correct implementation, but without the desired performance semantic. I
think this requires an update to cranelift to expose a suitable
instruction in its IR.

I have not tested with codegen_gcc, but it should behave the same
way (using `fma` from libc).
@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. labels Nov 2, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 2, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-codegen Area: Code generation A-cranelift Things relevant to the [future] cranelift backend labels Nov 2, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Nov 2, 2024

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 2, 2024
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 2, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 2, 2024

📌 Commit c959f6e 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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Nov 2, 2024
…bjorn3

Subtree sync for rustc_codegen_cranelift

The highlight this time is an update to Cranelift 0.113,

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
…kingjubilee

Rollup of 12 pull requests

Successful merges:

 - rust-lang#132393 (Docs: added brief colon explanation)
 - rust-lang#132419 (PassWrapper: adapt for llvm/llvm-project@b01e2a8b5620466c3b)
 - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate)
 - rust-lang#132458 (get rid of a whole bunch of unnecessary rustc_const_unstable attributes)
 - rust-lang#132499 (unicode_data.rs: show command for generating file)
 - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers)
 - rust-lang#132514 (Port most of `--print=target-cpus` to Rust)
 - rust-lang#132520 (NFC add known bug nr to test)
 - rust-lang#132522 (make codegen help output more consistent)
 - rust-lang#132523 (Added regression test for generics index out of bounds)
 - rust-lang#132526 (Subtree sync for rustc_codegen_cranelift)
 - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion)
 - rust-lang#132540 (Do not format generic consts)

Failed merges:

 - rust-lang#132511 (stabilize const_arguments_as_str)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

@bors p=1

@bors
Copy link
Collaborator

bors commented Nov 3, 2024

⌛ Testing commit c959f6e with merge 89ab655...

@bors
Copy link
Collaborator

bors commented Nov 3, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 3, 2024
@bors bors merged commit 89ab655 into rust-lang:master Nov 3, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 3, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (89ab655): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -2.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

Results (primary 1.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

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

Bootstrap: 780.354s -> 780.951s (0.08%)
Artifact size: 335.40 MiB -> 335.37 MiB (-0.01%)

@bjorn3 bjorn3 deleted the sync_cg_clif-2024-11-02 branch November 3, 2024 09:56
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Nov 9, 2024
…orn3

Subtree sync for rustc_codegen_cranelift

The highlight this time is an update to Cranelift 0.113,

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
# for free to join this conversation on GitHub. Already have an account? # 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 has-merge-commits PR has merge commits, merge with caution. 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.