Conversation
| // zero is unavailable because wrapping occurs | ||
| move_end(v) |
There was a problem hiding this comment.
Note that this arm just kinda gave up before; it never even considered whether putting it next to start might be better.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
302d83d to
a146c66
Compare
|
It helps to remember to |
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
a146c66 to
09df883
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ed76e05): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.9%, secondary -4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 491.618s -> 493.312s (0.34%) |
|
Wow, those results are way better than I expected 😅 Seems pretty clearly a net win to me. |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors try jobs=x86_64-gnu-llvm-22-1,x86_64-gnu-llvm-21-1 |
This comment has been minimized.
This comment has been minimized.
Prefer `-1` for `None` try-job: x86_64-gnu-llvm-22-1 try-job: x86_64-gnu-llvm-21-1
This comment has been minimized.
This comment has been minimized.
|
Oh no, the test passed in LLVM21 Also, it passes in stage1 but fails in stage2 😬 For extra hilarity, we have a test for rust/tests/codegen-llvm/option-niche-eq.rs Lines 77 to 84 in 5095b44 and that passes on both stage1 and stage2 |
|
💔 Test for fdc4b82 failed: CI. Failed job:
|
09df883 to
ebd82fb
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Currently we pick "weird" numbers like `1114112` for `None::<char>`. While that's not *wrong*, it's kinda *unnatural* -- a human wouldn't make that choice. This PR instead picks `-1` for thinge like `None::<char>` -- like clang's `WEOF` -- and `None::<bool>` and such. Any enums with more than one niched value (so not `Result` nor `Option`) remain as they were before.
ebd82fb to
ba1a33e
Compare
|
@bors try jobs=x86_64-gnu-llvm-22-1,x86_64-gnu-llvm-21-1 |
This comment has been minimized.
This comment has been minimized.
Prefer `-1` for `None` try-job: x86_64-gnu-llvm-22-1 try-job: x86_64-gnu-llvm-21-1
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (a6faa48): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.1%, secondary 1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 486.61s -> 487.264s (0.13%) |


View all comments
Currently we pick "weird" numbers like
1114112forNone::<char>. While that's not wrong, it's kinda unnatural -- a human wouldn't make that choice.This PR instead picks
-1for thinge likeNone::<char>-- like clang'sWEOF-- andNone::<bool>and such.Any enums with more than one niched value (so not
ResultnorOption) remain as they were before. Also we continue to use0when that's possible ---1is only preferred when zero isn't possible.Inspired when someone in discord posted an example like this https://rust.godbolt.org/z/W94s9qdYW and I thought it was odd that we're currently picking
-9223372036854775808to be the value to store to mark anOption<Vec<_>>asNone. (Especially since that needs an 8-byte immediate on x64, and writing-1is only a 4-byte immediate.)