emit attribute for readonly non-pure inline assembly#146791
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 22, 2025
Merged
emit attribute for readonly non-pure inline assembly#146791bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
cb41639 to
fd4fbd3
Compare
Member
|
LGTM (but not r+ing because you requested a specific reviewer). |
nikic
approved these changes
Sep 21, 2025
| } | ||
|
|
||
| // CHECK-LABEL: @readonly_not_pure | ||
| // CHECK: call i32 asm |
Contributor
There was a problem hiding this comment.
It would be good to check that the attributes are actually emitted on the right call. Something like call i32 asm {{.*}} #[[ATTR:\d+]] here and attributes #[[ATTR]] below should do it.
fd4fbd3 to
3565b06
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Contributor
Author
|
@bors r=nikic,joshtriplett |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 22, 2025
…kic,joshtriplett emit attribute for readonly non-pure inline assembly fixes rust-lang#146761 Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions. I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all. r? `@nikic` cc `@Amanieu`
bors
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup of 8 pull requests Successful merges: - #146317 (Add panic=immediate-abort) - #146397 (std_detect on Darwin AArch64: update features) - #146594 (bootstrap: Don't force -static for musl targets in cc-rs) - #146791 (emit attribute for readonly non-pure inline assembly) - #146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - #146838 (Introduce "wrapper" helpers to rustdoc) - #146846 (btree InternalNode::new safety comments) - #146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 22, 2025
…kic,joshtriplett emit attribute for readonly non-pure inline assembly fixes rust-lang#146761 Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions. I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all. r? ``@nikic`` cc ``@Amanieu``
bors
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup of 10 pull requests Successful merges: - #145411 (regression test for Cow<[u8]> layout) - #146317 (Add panic=immediate-abort) - #146397 (std_detect on Darwin AArch64: update features) - #146594 (bootstrap: Don't force -static for musl targets in cc-rs) - #146652 (Port `feature` to the new attribute system) - #146791 (emit attribute for readonly non-pure inline assembly) - #146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - #146838 (Introduce "wrapper" helpers to rustdoc) - #146846 (btree InternalNode::new safety comments) - #146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 22, 2025
…kic,joshtriplett emit attribute for readonly non-pure inline assembly fixes rust-lang#146761 Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions. I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all. r? ```@nikic``` cc ```@Amanieu```
bors
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup of 9 pull requests Successful merges: - #145411 (regression test for Cow<[u8]> layout) - #146317 (Add panic=immediate-abort) - #146397 (std_detect on Darwin AArch64: update features) - #146594 (bootstrap: Don't force -static for musl targets in cc-rs) - #146791 (emit attribute for readonly non-pure inline assembly) - #146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - #146838 (Introduce "wrapper" helpers to rustdoc) - #146846 (btree InternalNode::new safety comments) - #146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup of 9 pull requests Successful merges: - #145411 (regression test for Cow<[u8]> layout) - #146317 (Add panic=immediate-abort) - #146397 (std_detect on Darwin AArch64: update features) - #146594 (bootstrap: Don't force -static for musl targets in cc-rs) - #146791 (emit attribute for readonly non-pure inline assembly) - #146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - #146838 (Introduce "wrapper" helpers to rustdoc) - #146846 (btree InternalNode::new safety comments) - #146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup of 9 pull requests Successful merges: - #145411 (regression test for Cow<[u8]> layout) - #146397 (std_detect on Darwin AArch64: update features) - #146791 (emit attribute for readonly non-pure inline assembly) - #146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - #146838 (Introduce "wrapper" helpers to rustdoc) - #146845 (Add self-profile events for target-machine creation) - #146846 (btree InternalNode::new safety comments) - #146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) - #146878 (assert_unsafe_precondition: fix some incorrect check_language_ub) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Sep 22, 2025
Rollup merge of #146791 - folkertdev:readonly-not-pure, r=nikic,joshtriplett emit attribute for readonly non-pure inline assembly fixes #146761 Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions. I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all. r? ````@nikic```` cc ````@Amanieu````
Muscraft
pushed a commit
to Muscraft/rust
that referenced
this pull request
Sep 24, 2025
…kic,joshtriplett emit attribute for readonly non-pure inline assembly fixes rust-lang#146761 Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions. I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all. r? ````@nikic```` cc ````@Amanieu````
Muscraft
pushed a commit
to Muscraft/rust
that referenced
this pull request
Sep 24, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#145411 (regression test for Cow<[u8]> layout) - rust-lang#146397 (std_detect on Darwin AArch64: update features) - rust-lang#146791 (emit attribute for readonly non-pure inline assembly) - rust-lang#146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - rust-lang#146838 (Introduce "wrapper" helpers to rustdoc) - rust-lang#146845 (Add self-profile events for target-machine creation) - rust-lang#146846 (btree InternalNode::new safety comments) - rust-lang#146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) - rust-lang#146878 (assert_unsafe_precondition: fix some incorrect check_language_ub) r? `@ghost` `@rustbot` modify labels: rollup
Kobzol
pushed a commit
to Kobzol/rustc_codegen_gcc
that referenced
this pull request
Dec 21, 2025
Rollup of 9 pull requests Successful merges: - rust-lang/rust#145411 (regression test for Cow<[u8]> layout) - rust-lang/rust#146397 (std_detect on Darwin AArch64: update features) - rust-lang/rust#146791 (emit attribute for readonly non-pure inline assembly) - rust-lang/rust#146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly) - rust-lang/rust#146838 (Introduce "wrapper" helpers to rustdoc) - rust-lang/rust#146845 (Add self-profile events for target-machine creation) - rust-lang/rust#146846 (btree InternalNode::new safety comments) - rust-lang/rust#146858 (Make mips64el-unknown-linux-muslabi64 link dynamically) - rust-lang/rust#146878 (assert_unsafe_precondition: fix some incorrect check_language_ub) r? `@ghost` `@rustbot` modify labels: rollup
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #146761
Provide a better
MemoryEffectsto LLVM when an inline assembly block specifiesreadonlybut notpure. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions.I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying
readonlyat all.r? @nikic
cc @Amanieu