Skip to content

Remove LLVM attribute removal#94229

Merged
bors merged 1 commit intorust-lang:masterfrom
erikdesjardins:rem2
Mar 2, 2022
Merged

Remove LLVM attribute removal#94229
bors merged 1 commit intorust-lang:masterfrom
erikdesjardins:rem2

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

Loading
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