-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Enable function merging when opt is for size #100035
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Thanks for the PR, @workingjubilee! @rust-lang/wg-llvm, is there a chance that this increases the risk of miscompilations for Otherwise, this looks good to me. |
I don't think this meaningfully increases the risk of miscompilations, as we're already using MergeFunctions for other optimization levels. (Clang does not use the pass by default, so it does receive less upstream testing than would be ideal, but I don't think size optimizations are meaningfully different in this regard.) @bors r+ rollup=never |
📌 Commit 1def1cecb9d4310e51266358126e2895f36de574 has been approved by It is now in the queue for this repository. |
⌛ Testing commit 1def1cecb9d4310e51266358126e2895f36de574 with merge 4f607ea92e73e9b39a4a8c7ebd4a16a22d3ef80f... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors retry |
⌛ Testing commit 1def1cecb9d4310e51266358126e2895f36de574 with merge 8653ab47796c93b3e3b3c7ac2657a88a8fc489d4... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
huh, I could have sworn I tested that locally and it passed...? But now that I poke it, it perturbs fairly easily. I still want to test that |
@workingjubilee Well, at least as implemented |
Oh hm. Then... it's odd that it passed at all...? |
It is, of course, natural to want to merge aliasing functions when optimizing for code size, since that can eliminate several bytes. And an exhaustive match helps make the code less brittle.
665832a
to
80c9012
Compare
Going to resist the temptation to get rabbitholed and simply remove all testing for |
The tests run with @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (55f4641): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesThis benchmark run did not return any relevant results for this metric. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
FWIW Swift does use MergeFunctions by default, so there's not zero production testing. Of course, Swift uses its own fork of LLVM, so issues could still creep in. |
It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.
Closes #98215.