-
Notifications
You must be signed in to change notification settings - Fork 13.5k
centralize -Zmin-function-alignment
logic
#142854
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
Merged
bors
merged 1 commit into
rust-lang:master
from
folkertdev:centralize-min-function-alignment
Jun 23, 2025
Merged
centralize -Zmin-function-alignment
logic
#142854
bors
merged 1 commit into
rust-lang:master
from
folkertdev:centralize-min-function-alignment
Jun 23, 2025
+10
−17
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some changes occurred to the CTFE machinery Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs |
r? codegen |
98 tasks
This looks good to me. r? workingjubilee |
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 22, 2025
…-alignment, r=workingjubilee centralize `-Zmin-function-alignment` logic tracking issue: rust-lang#82232 discussed in: rust-lang#142824 (comment) Apply the `-Zmin-function-alignment` value to the alignment field of the function attributes when those are created, so that individual backends don't need to consider it. The one exception right now is cranelift, because it can't yet set the alignment for individual functions, but it can (and does) set the global minimum function alignment. cc `@RalfJung` I think this is an improvement regardless, is there anything else that should be done for miri?
bors
added a commit
that referenced
this pull request
Jun 23, 2025
Rollup of 6 pull requests Successful merges: - #140136 (Add an aarch64-msvc build running on ARM64 Windows) - #141597 (Document subdirectories of UI tests with README files) - #142823 (Port `#[no_mangle]` to new attribute parsing infrastructure) - #142828 (1.88.0 release notes) - #142854 (centralize `-Zmin-function-alignment` logic) - #142875 (Check rustdoc-json-types FORMAT_VERSION is correctly updated) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Jun 23, 2025
Rollup of 5 pull requests Successful merges: - #141597 (Document subdirectories of UI tests with README files) - #142823 (Port `#[no_mangle]` to new attribute parsing infrastructure) - #142828 (1.88.0 release notes) - #142854 (centralize `-Zmin-function-alignment` logic) - #142875 (Check rustdoc-json-types FORMAT_VERSION is correctly updated) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Jun 23, 2025
Rollup merge of #142854 - folkertdev:centralize-min-function-alignment, r=workingjubilee centralize `-Zmin-function-alignment` logic tracking issue: #82232 discussed in: #142824 (comment) Apply the `-Zmin-function-alignment` value to the alignment field of the function attributes when those are created, so that individual backends don't need to consider it. The one exception right now is cranelift, because it can't yet set the alignment for individual functions, but it can (and does) set the global minimum function alignment. cc ``@RalfJung`` I think this is an improvement regardless, is there anything else that should be done for miri?
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Jun 23, 2025
…no-attributes, r=workingjubilee fix `-Zmin-function-alignment` on functions without attributes tracking issue: rust-lang#82232 related: rust-lang#142854 The minimum function alignment was skipped on functions without attributes (because the logic was in a loop that only runs if there is at least one attribute). The underlying reason we didn't catch this before is that in our testing we generally apply `#[no_mangle]` to functions that are tested. I've added a test now that deliberately has no attributes. r? `@workingjubilee`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tracking issue: #82232
discussed in: #142824 (comment)
Apply the
-Zmin-function-alignment
value to the alignment field of the function attributes when those are created, so that individual backends don't need to consider it.The one exception right now is cranelift, because it can't yet set the alignment for individual functions, but it can (and does) set the global minimum function alignment.
cc @RalfJung I think this is an improvement regardless, is there anything else that should be done for miri?