Skip to content

Commit 744bd01

Browse files
committed
Replace undefined value with poison value
1 parent de0fd64 commit 744bd01

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/unittests/Analysis/PhiValuesTest.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ TEST(PhiValuesTest, SimplePhi) {
3434
BasicBlock *If = BasicBlock::Create(C, "if", F);
3535
BasicBlock *Else = BasicBlock::Create(C, "else", F);
3636
BasicBlock *Then = BasicBlock::Create(C, "then", F);
37-
BranchInst::Create(If, Else, UndefValue::get(I1Ty), Entry);
37+
BranchInst::Create(If, Else, PoisonValue::get(I1Ty), Entry);
3838
BranchInst::Create(Then, If);
3939
BranchInst::Create(Then, Else);
4040

41-
Value *Val1 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val1", Entry);
42-
Value *Val2 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val2", Entry);
43-
Value *Val3 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val3", Entry);
44-
Value *Val4 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val4", Entry);
41+
Value *Val1 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val1", Entry);
42+
Value *Val2 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val2", Entry);
43+
Value *Val3 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val3", Entry);
44+
Value *Val4 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val4", Entry);
4545

4646
PHINode *Phi1 = PHINode::Create(I32Ty, 2, "phi1", Then);
4747
Phi1->addIncoming(Val1, If);
@@ -104,17 +104,17 @@ TEST(PhiValuesTest, DependentPhi) {
104104
BasicBlock *If2 = BasicBlock::Create(C, "if2", F);
105105
BasicBlock *Else2 = BasicBlock::Create(C, "else2", F);
106106
BasicBlock *End = BasicBlock::Create(C, "then", F);
107-
BranchInst::Create(If1, Else1, UndefValue::get(I1Ty), Entry);
107+
BranchInst::Create(If1, Else1, PoisonValue::get(I1Ty), Entry);
108108
BranchInst::Create(Then, If1);
109109
BranchInst::Create(Then, Else1);
110-
BranchInst::Create(If2, Else2, UndefValue::get(I1Ty), Then);
110+
BranchInst::Create(If2, Else2, PoisonValue::get(I1Ty), Then);
111111
BranchInst::Create(End, If2);
112112
BranchInst::Create(End, Else2);
113113

114-
Value *Val1 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val1", Entry);
115-
Value *Val2 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val2", Entry);
116-
Value *Val3 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val3", Entry);
117-
Value *Val4 = new LoadInst(I32Ty, UndefValue::get(PtrTy), "val4", Entry);
114+
Value *Val1 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val1", Entry);
115+
Value *Val2 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val2", Entry);
116+
Value *Val3 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val3", Entry);
117+
Value *Val4 = new LoadInst(I32Ty, PoisonValue::get(PtrTy), "val4", Entry);
118118

119119
PHINode *Phi1 = PHINode::Create(I32Ty, 2, "phi1", Then);
120120
Phi1->addIncoming(Val1, If1);

0 commit comments

Comments
 (0)