Compare commits

...

1 commit

Author SHA1 Message Date
Harrison Hao
1e03575d2c [LowerAtomic] Clear elementwise flag when lowering atomic load 2026-08-01 10:55:12 +08:00
2 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,7 @@ static bool LowerFenceInst(FenceInst *FI) {
static bool LowerLoadInst(LoadInst *LI) {
LI->setAtomic(AtomicOrdering::NotAtomic);
LI->setElementwise(false);
return true;
}

View file

@ -0,0 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt < %s -passes=lower-atomic -S | FileCheck %s
define <2 x i32> @load_elementwise(ptr %p) {
; CHECK-LABEL: define <2 x i32> @load_elementwise(
; CHECK-SAME: ptr [[P:%.*]]) {
; CHECK-NEXT: [[V:%.*]] = load <2 x i32>, ptr [[P]], align 4
; CHECK-NEXT: ret <2 x i32> [[V]]
;
%v = load atomic elementwise <2 x i32>, ptr %p monotonic, align 4
ret <2 x i32> %v
}