-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 6 pull requests #67220
Rollup of 6 pull requests #67220
Conversation
Casting the booleans to `i8`s and converting their difference into `Ordering` generates better assembly than casting them to `u8`s and comparing them.
We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes rust-lang#66971 Fixes rust-lang#66339 Fixes rust-lang#67019
…-ord-optimization, r=sfackler Optimize Ord trait implementation for bool Casting the booleans to `i8`s and converting their difference into `Ordering` generates better assembly than casting them to `u8`s and comparing them. Fixes rust-lang#66780 #### Comparison([Godbolt link](https://rust.godbolt.org/z/PjBpvF)) ##### Old assembly: ```asm example::boolean_cmp: mov ecx, edi xor ecx, esi test esi, esi mov eax, 255 cmove eax, ecx test edi, edi cmovne eax, ecx ret ``` ##### New assembly: ```asm example::boolean_cmp: mov eax, edi sub al, sil ret ``` ##### Old LLVM-MCA statistics: ``` Iterations: 100 Instructions: 800 Total Cycles: 234 Total uOps: 1000 Dispatch Width: 6 uOps Per Cycle: 4.27 IPC: 3.42 Block RThroughput: 1.7 ``` ##### New LLVM-MCA statistics: ``` Iterations: 100 Instructions: 300 Total Cycles: 110 Total uOps: 500 Dispatch Width: 6 uOps Per Cycle: 4.55 IPC: 2.73 Block RThroughput: 1.0 ```
Fix constant propagation for scalar pairs We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes rust-lang#66971 Fixes rust-lang#66339 Fixes rust-lang#67019
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on rust-lang#54020, and can be used in the future to replace and simplify some of the Makefile tests.
…=oli-obk Ensure that panicking in constants eventually errors based on rust-lang#67134 closes rust-lang#66975 r? @oli-obk
Remove `checked_add` in `Layout::repeat`
Make `publish_toolstate.sh` executable It causes a failure on master ([log](https://dev.azure.com/rust-lang/rust/_build/results?buildId=15627)). r? @pietroalbini CC: @Mark-Simulacrum
@bors r+ p=6 rollup=never |
📌 Commit f6ceef5 has been approved by |
@bors p=2000 |
Rollup of 6 pull requests Successful merges: - #66881 (Optimize Ord trait implementation for bool) - #67015 (Fix constant propagation for scalar pairs) - #67074 (Add options to --extern flag.) - #67164 (Ensure that panicking in constants eventually errors) - #67174 (Remove `checked_add` in `Layout::repeat`) - #67205 (Make `publish_toolstate.sh` executable) Failed merges: r? @ghost
☀️ Test successful - checks-azure |
Before I forget about it, I think something in this rollup caused a noticeable regression. cc @rust-lang/wg-compiler-performance |
Should we file an issue to track that ? |
@oli-obk: Could #67164 have caused the regression? @krishna-veerareddy: Could #66881 have cause the regression? @ehuss: Could #67074 have caused the regression? #67174 and #67205 seem very unlikely to be the cause. I just tried to work out which commit caused the problem but failed; every revision I tried (even blatantly pre-merge ones) had the same post-regression numbers on |
@nnethercote Hey sorry for the late response. It's unlikely that 66881 could have caused a regression since it has to do with boolean comparision which isn't used quite often and if anything the fix should have reduced the instruction count but I could be wrong. Is this still an unresolved issue? |
Successful merges:
checked_add
inLayout::repeat
#67174 (Removechecked_add
inLayout::repeat
)publish_toolstate.sh
executable #67205 (Makepublish_toolstate.sh
executable)Failed merges:
r? @ghost