Skip to content
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

Merged
merged 1 commit into from
Mar 2, 2022
Merged

Remove LLVM attribute removal #94229

merged 1 commit into from
Mar 2, 2022

Conversation

erikdesjardins
Copy link
Contributor

This was necessary before, because declare_raw_fn would always apply
the default optimization attributes to every declared function.
Then attributes::from_fn_attrs would have to remove the default
attributes 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 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 remove the attribute setting
from declare_raw_fn, and rely on from_fn_attrs to apply the correct
attributes all at once.

r? @ghost (blocked on #94221)
@rustbot label S-blocked

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Feb 21, 2022
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.
@workingjubilee
Copy link
Member

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 1, 2022
@bors
Copy link
Contributor

bors commented Mar 1, 2022

⌛ Trying commit dce14cf with merge 4e2e8775a1f0665698f5ed4893179acb5051aae8...

@bors
Copy link
Contributor

bors commented Mar 1, 2022

☀️ Try build successful - checks-actions
Build commit: 4e2e8775a1f0665698f5ed4893179acb5051aae8 (4e2e8775a1f0665698f5ed4893179acb5051aae8)

@rust-timer
Copy link
Collaborator

Queued 4e2e8775a1f0665698f5ed4893179acb5051aae8 with parent 4ce3749, future comparison URL.

@rust-timer
Copy link
Collaborator

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
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 1, 2022
@nikic
Copy link
Contributor

nikic commented Mar 1, 2022

Your reasoning sounds right to me and this is a nice cleanup...

@bors r+

@bors
Copy link
Contributor

bors commented Mar 1, 2022

📌 Commit dce14cf has been approved by nikic

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Mar 1, 2022
@bors
Copy link
Contributor

bors commented Mar 2, 2022

⌛ Testing commit dce14cf with merge c42d846...

@bors
Copy link
Contributor

bors commented Mar 2, 2022

☀️ Test successful - checks-actions
Approved by: nikic
Pushing c42d846 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 2, 2022
@bors bors merged commit c42d846 into rust-lang:master Mar 2, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 2, 2022
@rust-timer
Copy link
Collaborator

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

@erikdesjardins erikdesjardins deleted the rem2 branch March 2, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants