Skip to content

Commit f8a6ba8

Browse files
nikicAlexisPerry
authored andcommitted
[VPlanTest] Use poison instead of undef for dummy values (NFC)
1 parent ed428d2 commit f8a6ba8

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,8 @@ TEST(VPRecipeTest, CastVPWidenRecipeToVPUser) {
875875
LLVMContext C;
876876

877877
IntegerType *Int32 = IntegerType::get(C, 32);
878-
auto *AI =
879-
BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
878+
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
879+
PoisonValue::get(Int32));
880880
VPValue Op1;
881881
VPValue Op2;
882882
SmallVector<VPValue *, 2> Args;
@@ -924,7 +924,7 @@ TEST(VPRecipeTest, CastVPWidenSelectRecipeToVPUserAndVPDef) {
924924
IntegerType *Int1 = IntegerType::get(C, 1);
925925
IntegerType *Int32 = IntegerType::get(C, 32);
926926
auto *SelectI = SelectInst::Create(
927-
UndefValue::get(Int1), UndefValue::get(Int32), UndefValue::get(Int32));
927+
PoisonValue::get(Int1), PoisonValue::get(Int32), PoisonValue::get(Int32));
928928
VPValue Op1;
929929
VPValue Op2;
930930
VPValue Op3;
@@ -951,8 +951,8 @@ TEST(VPRecipeTest, CastVPWidenGEPRecipeToVPUserAndVPDef) {
951951

952952
IntegerType *Int32 = IntegerType::get(C, 32);
953953
PointerType *Int32Ptr = PointerType::get(Int32, 0);
954-
auto *GEP = GetElementPtrInst::Create(Int32, UndefValue::get(Int32Ptr),
955-
UndefValue::get(Int32));
954+
auto *GEP = GetElementPtrInst::Create(Int32, PoisonValue::get(Int32Ptr),
955+
PoisonValue::get(Int32));
956956
VPValue Op1;
957957
VPValue Op2;
958958
SmallVector<VPValue *, 4> Args;
@@ -1014,7 +1014,7 @@ TEST(VPRecipeTest, CastVPReplicateRecipeToVPUser) {
10141014

10151015
IntegerType *Int32 = IntegerType::get(C, 32);
10161016
FunctionType *FTy = FunctionType::get(Int32, false);
1017-
auto *Call = CallInst::Create(FTy, UndefValue::get(FTy));
1017+
auto *Call = CallInst::Create(FTy, PoisonValue::get(FTy));
10181018
VPReplicateRecipe Recipe(Call, make_range(Args.begin(), Args.end()), true);
10191019
EXPECT_TRUE(isa<VPUser>(&Recipe));
10201020
VPRecipeBase *BaseR = &Recipe;
@@ -1039,7 +1039,7 @@ TEST(VPRecipeTest, CastVPWidenMemoryRecipeToVPUserAndVPDef) {
10391039
IntegerType *Int32 = IntegerType::get(C, 32);
10401040
PointerType *Int32Ptr = PointerType::get(Int32, 0);
10411041
auto *Load =
1042-
new LoadInst(Int32, UndefValue::get(Int32Ptr), "", false, Align(1));
1042+
new LoadInst(Int32, PoisonValue::get(Int32Ptr), "", false, Align(1));
10431043
VPValue Addr;
10441044
VPValue Mask;
10451045
VPWidenLoadRecipe Recipe(*Load, &Addr, &Mask, true, false, {});
@@ -1062,8 +1062,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
10621062
PointerType *Int32Ptr = PointerType::get(Int32, 0);
10631063

10641064
{
1065-
auto *AI = BinaryOperator::CreateAdd(UndefValue::get(Int32),
1066-
UndefValue::get(Int32));
1065+
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
1066+
PoisonValue::get(Int32));
10671067
VPValue Op1;
10681068
VPValue Op2;
10691069
SmallVector<VPValue *, 2> Args;
@@ -1078,8 +1078,9 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
10781078
}
10791079

10801080
{
1081-
auto *SelectI = SelectInst::Create(
1082-
UndefValue::get(Int1), UndefValue::get(Int32), UndefValue::get(Int32));
1081+
auto *SelectI =
1082+
SelectInst::Create(PoisonValue::get(Int1), PoisonValue::get(Int32),
1083+
PoisonValue::get(Int32));
10831084
VPValue Op1;
10841085
VPValue Op2;
10851086
VPValue Op3;
@@ -1096,8 +1097,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
10961097
}
10971098

10981099
{
1099-
auto *GEP = GetElementPtrInst::Create(Int32, UndefValue::get(Int32Ptr),
1100-
UndefValue::get(Int32));
1100+
auto *GEP = GetElementPtrInst::Create(Int32, PoisonValue::get(Int32Ptr),
1101+
PoisonValue::get(Int32));
11011102
VPValue Op1;
11021103
VPValue Op2;
11031104
SmallVector<VPValue *, 4> Args;
@@ -1134,7 +1135,7 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
11341135

11351136
{
11361137
auto *Load =
1137-
new LoadInst(Int32, UndefValue::get(Int32Ptr), "", false, Align(1));
1138+
new LoadInst(Int32, PoisonValue::get(Int32Ptr), "", false, Align(1));
11381139
VPValue Addr;
11391140
VPValue Mask;
11401141
VPWidenLoadRecipe Recipe(*Load, &Addr, &Mask, true, false, {});
@@ -1146,8 +1147,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
11461147
}
11471148

11481149
{
1149-
auto *Store = new StoreInst(UndefValue::get(Int32),
1150-
UndefValue::get(Int32Ptr), false, Align(1));
1150+
auto *Store = new StoreInst(PoisonValue::get(Int32),
1151+
PoisonValue::get(Int32Ptr), false, Align(1));
11511152
VPValue Addr;
11521153
VPValue Mask;
11531154
VPValue StoredV;
@@ -1242,8 +1243,8 @@ TEST(VPRecipeTest, dumpRecipeInPlan) {
12421243
LLVMContext C;
12431244

12441245
IntegerType *Int32 = IntegerType::get(C, 32);
1245-
auto *AI =
1246-
BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
1246+
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
1247+
PoisonValue::get(Int32));
12471248
AI->setName("a");
12481249
SmallVector<VPValue *, 2> Args;
12491250
VPValue *ExtVPV1 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 1));
@@ -1296,8 +1297,8 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
12961297
LLVMContext C;
12971298

12981299
IntegerType *Int32 = IntegerType::get(C, 32);
1299-
auto *AI =
1300-
BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
1300+
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
1301+
PoisonValue::get(Int32));
13011302
AI->setName("a");
13021303
SmallVector<VPValue *, 2> Args;
13031304
VPValue *ExtVPV1 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 1));
@@ -1377,8 +1378,8 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
13771378
TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesNotInPlanOrBlock) {
13781379
LLVMContext C;
13791380
IntegerType *Int32 = IntegerType::get(C, 32);
1380-
auto *AI =
1381-
BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
1381+
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
1382+
PoisonValue::get(Int32));
13821383
AI->setName("a");
13831384
VPValue *ExtVPV1 = new VPValue(ConstantInt::get(Int32, 1));
13841385
VPValue *ExtVPV2 = new VPValue(AI);

0 commit comments

Comments
 (0)