-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Tell LLVM Vec::len is invariant across growth #123930
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
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…, r=<try> Tell LLVM Vec::len is invariant across growth This allows LLVM to avoid re-loading it from memory.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (e80b3f5): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 677.239s -> 676.592s (-0.10%) |
Hard to say whether this is an improvement based on perf results, which seems pretty much as expected. A single, definitely-in-cache load is unlikely to be worth much to remove. I don't have a strong opinion on landing this vs. not, I'd probably bias slightly towards doing so since the load does mean more work for various parts of the pipeline even if it is cheap. |
What could be causing the regressions here? |
I looked at the regression in hyper-0.14.18 Opt IncrPatched, and it seems to be a little more time spent in LLVM optimizations. My guess is that LLVM is able to potentially benefit from this information and so spends a bit more time processing. |
e658123
to
61ebcf4
Compare
So the possibility for slightly better optimization. Given that this is trivially reverted if wanted, I'm going to go ahead and merge. @bors r+ rollup=never |
…, r=jhpratt Tell LLVM Vec::len is invariant across growth This allows LLVM to avoid re-loading it from memory.
This needs some test to prevent accidental regression? |
💥 Test timed out |
@bors r- |
61ebcf4
to
a79d3cc
Compare
@bors r=jhpratt |
…, r=jhpratt Tell LLVM Vec::len is invariant across growth This allows LLVM to avoid re-loading it from memory.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
a79d3cc
to
e644302
Compare
This saves an extra load from memory.
e644302
to
f1ae531
Compare
@bors r=jhpratt |
☀️ Test successful - checks-actions |
Finished benchmarking commit (13eb8c7): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 673.693s -> 672.201s (-0.22%) |
@Mark-Simulacrum noted the regressions here as coming in LLVM, and it was deemed worth it given the possibility for LLVM to perform more optimization. @rustbot label: +perf-regression-triaged |
This allows LLVM to avoid re-loading it from memory.