-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
At opt-level=0, apply only ABI-affecting attributes to functions #94127
Conversation
This should provide a small perf improvement for debug builds, and should more than cancel out the regression from adding noundef, which was only significant in debug builds.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit dcbdc8c with merge 3515289ab467c3593651fc70949029eba87453b3... |
☀️ Try build successful - checks-actions |
Queued 3515289ab467c3593651fc70949029eba87453b3 with parent b8c56fa, future comparison URL. |
Finished benchmarking commit (3515289ab467c3593651fc70949029eba87453b3): comparison url. Summary: This benchmark run shows 49 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. @bors rollup=never |
It may be worthwhile to split our LLVM attribute APIs into ones that create an Attribute, an then another that applies a whole list of attributes to an index. What we're doing right now if really inefficient and will end up interning a lot of unnecessary AttributeSets and AttributeLists. |
I'll work on that next, after my current batch of PRs. Unless you're suggesting that it would make our attribute manipulation fast enough that this PR would no longer be necessary? |
I suspect so, but I don't particularly mind the conditional attributes either. @bors r+ |
📌 Commit 6e740ae has been approved by |
⌛ Testing commit 6e740ae with merge 47b2057e8ae367c39665eff9045230bfb2c9e114... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r+ |
📌 Commit b0921f8 has been approved by |
⌛ Testing commit b0921f8 with merge bab0f5360a62cdad0937140a441e1416ff807834... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r+ |
📌 Commit 945276c has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (8128e91): comparison url. Summary: This benchmark run shows 39 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Add LLVM attributes in batches instead of individually This should improve performance. ~r? `@ghost` (blocked on rust-lang#94127)~
Apply noundef attribute to all scalar types which do not permit raw init Beyond `&`/`&mut`/`Box`, this covers `char`, enum discriminants, `NonZero*`, etc. All such types currently cause a Miri error if left uninitialized, and an `invalid_value` lint in cases like `mem::uninitialized::<char>()`. Note that this _does not_ change whether or not it is UB for `u64` (or other integer types with no invalid values) to be undef. Fixes (partially) rust-lang#74378. r? `@ghost` (blocked on rust-lang#94127) `@rustbot` label S-blocked
This should provide a small perf improvement for debug builds,
and should more than cancel out the perf regression from adding noundef (#93670 (comment), #94106).
r? @nikic