diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-22 20:25:13 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-22 20:25:13 +1000 |
| commit | 40db498a0f0291dde25380adda38cce29e4668cd (patch) | |
| tree | 2331cb2924fa647e961b7e3e72e23afcd0d72cff /compiler/rustc_codegen_llvm/src/llvm/ffi.rs | |
| parent | d144638f8972f532e03e019bc88760ab4d33aa8b (diff) | |
| parent | 3565b0699d6830dc31732afa96272bcbd1f83606 (diff) | |
| download | rust-40db498a0f0291dde25380adda38cce29e4668cd.tar.gz rust-40db498a0f0291dde25380adda38cce29e4668cd.zip | |
Rollup merge of #146791 - folkertdev:readonly-not-pure, r=nikic,joshtriplett
emit attribute for readonly non-pure inline assembly fixes https://github.com/rust-lang/rust/issues/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````
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 9a86e4373d8..fd972f371df 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -710,6 +710,7 @@ pub(crate) enum MemoryEffects { None, ReadOnly, InaccessibleMemOnly, + ReadOnlyNotPure, } /// LLVMOpcode |
