Skip to content

Commit b50e1bd

Browse files
committed
Revert "[CodeGen] Use poison instead of undef as placeholder in AtomicExpandPass [NFC]"
This reverts commit f50423c.
1 parent 878010d commit b50e1bd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/lib/CodeGen/AtomicExpandPass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ bool AtomicExpand::expandPartwordCmpXchg(AtomicCmpXchgInst *CI) {
10301030
Builder.SetInsertPoint(CI);
10311031

10321032
Value *FinalOldVal = extractMaskedValue(Builder, OldVal, PMV);
1033-
Value *Res = PoisonValue::get(CI->getType());
1033+
Value *Res = UndefValue::get(CI->getType());
10341034
Res = Builder.CreateInsertValue(Res, FinalOldVal, 0);
10351035
Res = Builder.CreateInsertValue(Res, Success, 1);
10361036

@@ -1094,7 +1094,7 @@ void AtomicExpand::expandAtomicCmpXchgToMaskedIntrinsic(AtomicCmpXchgInst *CI) {
10941094
Builder, CI, PMV.AlignedAddr, CmpVal_Shifted, NewVal_Shifted, PMV.Mask,
10951095
CI->getMergedOrdering());
10961096
Value *FinalOldVal = extractMaskedValue(Builder, OldVal, PMV);
1097-
Value *Res = PoisonValue::get(CI->getType());
1097+
Value *Res = UndefValue::get(CI->getType());
10981098
Res = Builder.CreateInsertValue(Res, FinalOldVal, 0);
10991099
Value *Success = Builder.CreateICmpEQ(
11001100
CmpVal_Shifted, Builder.CreateAnd(OldVal, PMV.Mask), "Success");
@@ -1186,7 +1186,7 @@ AtomicExpand::convertCmpXchgToIntegerType(AtomicCmpXchgInst *CI) {
11861186

11871187
OldVal = Builder.CreateIntToPtr(OldVal, CI->getCompareOperand()->getType());
11881188

1189-
Value *Res = PoisonValue::get(CI->getType());
1189+
Value *Res = UndefValue::get(CI->getType());
11901190
Res = Builder.CreateInsertValue(Res, OldVal, 0);
11911191
Res = Builder.CreateInsertValue(Res, Succ, 1);
11921192

@@ -1430,7 +1430,7 @@ bool AtomicExpand::expandAtomicCmpXchg(AtomicCmpXchgInst *CI) {
14301430
// Some use of the full struct return that we don't understand has happened,
14311431
// so we've got to reconstruct it properly.
14321432
Value *Res;
1433-
Res = Builder.CreateInsertValue(PoisonValue::get(CI->getType()), Loaded, 0);
1433+
Res = Builder.CreateInsertValue(UndefValue::get(CI->getType()), Loaded, 0);
14341434
Res = Builder.CreateInsertValue(Res, Success, 1);
14351435

14361436
CI->replaceAllUsesWith(Res);
@@ -1923,7 +1923,7 @@ bool AtomicExpand::expandAtomicOpToLibcall(
19231923
// The final result from the CAS is {load of 'expected' alloca, bool result
19241924
// from call}
19251925
Type *FinalResultTy = I->getType();
1926-
Value *V = PoisonValue::get(FinalResultTy);
1926+
Value *V = UndefValue::get(FinalResultTy);
19271927
Value *ExpectedOut = Builder.CreateAlignedLoad(
19281928
CASExpected->getType(), AllocaCASExpected, AllocaAlignment);
19291929
Builder.CreateLifetimeEnd(AllocaCASExpected_i8, SizeVal64);

llvm/test/Transforms/AtomicExpand/X86/expand-atomic-non-integer.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ define void @pointer_cmpxchg_expand(i8** %ptr, i8* %v) {
8888
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
8989
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
9090
; CHECK: %6 = inttoptr i64 %4 to i8*
91-
; CHECK: %7 = insertvalue { i8*, i1 } poison, i8* %6, 0
91+
; CHECK: %7 = insertvalue { i8*, i1 } undef, i8* %6, 0
9292
; CHECK: %8 = insertvalue { i8*, i1 } %7, i1 %5, 1
9393
cmpxchg i8** %ptr, i8* null, i8* %v seq_cst monotonic
9494
ret void
@@ -102,7 +102,7 @@ define void @pointer_cmpxchg_expand2(i8** %ptr, i8* %v) {
102102
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
103103
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
104104
; CHECK: %6 = inttoptr i64 %4 to i8*
105-
; CHECK: %7 = insertvalue { i8*, i1 } poison, i8* %6, 0
105+
; CHECK: %7 = insertvalue { i8*, i1 } undef, i8* %6, 0
106106
; CHECK: %8 = insertvalue { i8*, i1 } %7, i1 %5, 1
107107
cmpxchg i8** %ptr, i8* null, i8* %v release monotonic
108108
ret void
@@ -116,7 +116,7 @@ define void @pointer_cmpxchg_expand3(i8** %ptr, i8* %v) {
116116
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
117117
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
118118
; CHECK: %6 = inttoptr i64 %4 to i8*
119-
; CHECK: %7 = insertvalue { i8*, i1 } poison, i8* %6, 0
119+
; CHECK: %7 = insertvalue { i8*, i1 } undef, i8* %6, 0
120120
; CHECK: %8 = insertvalue { i8*, i1 } %7, i1 %5, 1
121121
cmpxchg i8** %ptr, i8* null, i8* %v seq_cst seq_cst
122122
ret void
@@ -130,7 +130,7 @@ define void @pointer_cmpxchg_expand4(i8** %ptr, i8* %v) {
130130
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
131131
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
132132
; CHECK: %6 = inttoptr i64 %4 to i8*
133-
; CHECK: %7 = insertvalue { i8*, i1 } poison, i8* %6, 0
133+
; CHECK: %7 = insertvalue { i8*, i1 } undef, i8* %6, 0
134134
; CHECK: %8 = insertvalue { i8*, i1 } %7, i1 %5, 1
135135
cmpxchg weak i8** %ptr, i8* null, i8* %v seq_cst seq_cst
136136
ret void
@@ -144,7 +144,7 @@ define void @pointer_cmpxchg_expand5(i8** %ptr, i8* %v) {
144144
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
145145
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
146146
; CHECK: %6 = inttoptr i64 %4 to i8*
147-
; CHECK: %7 = insertvalue { i8*, i1 } poison, i8* %6, 0
147+
; CHECK: %7 = insertvalue { i8*, i1 } undef, i8* %6, 0
148148
; CHECK: %8 = insertvalue { i8*, i1 } %7, i1 %5, 1
149149
cmpxchg volatile i8** %ptr, i8* null, i8* %v seq_cst seq_cst
150150
ret void
@@ -159,7 +159,7 @@ define void @pointer_cmpxchg_expand6(i8 addrspace(2)* addrspace(1)* %ptr,
159159
; CHECK: %4 = extractvalue { i64, i1 } %3, 0
160160
; CHECK: %5 = extractvalue { i64, i1 } %3, 1
161161
; CHECK: %6 = inttoptr i64 %4 to i8 addrspace(2)*
162-
; CHECK: %7 = insertvalue { i8 addrspace(2)*, i1 } poison, i8 addrspace(2)* %6, 0
162+
; CHECK: %7 = insertvalue { i8 addrspace(2)*, i1 } undef, i8 addrspace(2)* %6, 0
163163
; CHECK: %8 = insertvalue { i8 addrspace(2)*, i1 } %7, i1 %5, 1
164164
cmpxchg i8 addrspace(2)* addrspace(1)* %ptr, i8 addrspace(2)* null, i8 addrspace(2)* %v seq_cst seq_cst
165165
ret void

0 commit comments

Comments
 (0)