-
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
Remove LLVM attribute removal #94229
Conversation
This was necessary before, because `declare_raw_fn` would always apply the default optimization attributes to every declared function, and then `attributes::from_fn_attrs` would have to remove the default attributes in the case of, e.g. `#[optimize(speed)]` in a `-Os` build. However, every relevant callsite of `declare_raw_fn` (i.e. where we actually generate code for the function, and not e.g. a call to an intrinsic, where optimization attributes don't [?] matter) calls `from_fn_attrs`, so we can simply remove the attribute setting from `declare_raw_fn`, and rely on `from_fn_attrs` to apply the correct attributes all at once.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit dce14cf with merge 4e2e8775a1f0665698f5ed4893179acb5051aae8... |
☀️ Try build successful - checks-actions |
Queued 4e2e8775a1f0665698f5ed4893179acb5051aae8 with parent 4ce3749, future comparison URL. |
Finished benchmarking commit (4e2e8775a1f0665698f5ed4893179acb5051aae8): comparison url. Summary: This benchmark run did not return any relevant results. 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 |
Your reasoning sounds right to me and this is a nice cleanup... @bors r+ |
📌 Commit dce14cf has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c42d846): comparison url. Summary: This benchmark run did not return any relevant results. 4 results were found to be statistically significant but too small to be relevant. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This was necessary before, because
declare_raw_fn
would always applythe default optimization attributes to every declared function.
Then
attributes::from_fn_attrs
would have to remove the defaultattributes in the case of, e.g.
#[optimize(speed)]
in a-Os
build.(see
src/test/codegen/optimize-attr-1.rs
)However, every relevant callsite of
declare_raw_fn
(i.e. where weactually generate code for the function, and not e.g. a call to an
intrinsic, where optimization attributes don't [?] matter)
calls
from_fn_attrs
, so we can remove the attribute settingfrom
declare_raw_fn
, and rely onfrom_fn_attrs
to apply the correctattributes all at once.
r? @ghost (blocked on #94221)
@rustbot label S-blocked