[LowerAtomic] Clear elementwise flag when lowering atomic load
This commit is contained in:
parent
2e81492b8a
commit
1e03575d2c
2 changed files with 13 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ static bool LowerFenceInst(FenceInst *FI) {
|
|||
|
||||
static bool LowerLoadInst(LoadInst *LI) {
|
||||
LI->setAtomic(AtomicOrdering::NotAtomic);
|
||||
LI->setElementwise(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in a new issue