[clang] [CIR] Add handling for volatile loads and stores (PR #156124)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 2 06:53:25 PDT 2025
================
@@ -416,18 +420,26 @@ def CIR_LoadOp : CIR_Op<"load", [
// Load address from memory at address %0. %3 is used by at least one
// operation that dereferences a pointer.
%3 = cir.load deref %0 : !cir.ptr<!cir.ptr<i32>>
+
+ // Perform a volatile load from address in %0.
+ %4 = cir.load volatile %0 : !cir.ptr<i32>, i32
+
+ // Others
+ %x = cir.load align(16) atomic(seq_cst) %0 : !cir.ptr<i32>, i32
```
}];
let arguments = (ins Arg<CIR_PointerType, "the address to load from",
[MemRead]>:$addr,
UnitAttr:$isDeref,
OptionalAttr<I64Attr>:$alignment,
+ UnitAttr:$is_volatile,
----------------
xlauko wrote:
`isDeref` should be snake_case to match the rest of `is_` attributes, but that probably for another typo PR.
https://github.com/llvm/llvm-project/pull/156124
More information about the cfe-commits
mailing list