[llvm] 9952e00 - [VPlanTest] Use poison instead of undef for dummy values (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 25 03:56:18 PDT 2024
Author: Nikita Popov
Date: 2024-06-25T12:56:10+02:00
New Revision: 9952e00af6c93e9807c3dfe076e99e7f5a77f675
URL: https://github.com/llvm/llvm-project/commit/9952e00af6c93e9807c3dfe076e99e7f5a77f675
DIFF: https://github.com/llvm/llvm-project/commit/9952e00af6c93e9807c3dfe076e99e7f5a77f675.diff
LOG: [VPlanTest] Use poison instead of undef for dummy values (NFC)
Added:
Modified:
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
index 5c45d86130bdc..4022c343d63ef 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
@@ -875,8 +875,8 @@ TEST(VPRecipeTest, CastVPWidenRecipeToVPUser) {
LLVMContext C;
IntegerType *Int32 = IntegerType::get(C, 32);
- auto *AI =
- BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
+ auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
SmallVector<VPValue *, 2> Args;
@@ -924,7 +924,7 @@ TEST(VPRecipeTest, CastVPWidenSelectRecipeToVPUserAndVPDef) {
IntegerType *Int1 = IntegerType::get(C, 1);
IntegerType *Int32 = IntegerType::get(C, 32);
auto *SelectI = SelectInst::Create(
- UndefValue::get(Int1), UndefValue::get(Int32), UndefValue::get(Int32));
+ PoisonValue::get(Int1), PoisonValue::get(Int32), PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
VPValue Op3;
@@ -951,8 +951,8 @@ TEST(VPRecipeTest, CastVPWidenGEPRecipeToVPUserAndVPDef) {
IntegerType *Int32 = IntegerType::get(C, 32);
PointerType *Int32Ptr = PointerType::get(Int32, 0);
- auto *GEP = GetElementPtrInst::Create(Int32, UndefValue::get(Int32Ptr),
- UndefValue::get(Int32));
+ auto *GEP = GetElementPtrInst::Create(Int32, PoisonValue::get(Int32Ptr),
+ PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
SmallVector<VPValue *, 4> Args;
@@ -1014,7 +1014,7 @@ TEST(VPRecipeTest, CastVPReplicateRecipeToVPUser) {
IntegerType *Int32 = IntegerType::get(C, 32);
FunctionType *FTy = FunctionType::get(Int32, false);
- auto *Call = CallInst::Create(FTy, UndefValue::get(FTy));
+ auto *Call = CallInst::Create(FTy, PoisonValue::get(FTy));
VPReplicateRecipe Recipe(Call, make_range(Args.begin(), Args.end()), true);
EXPECT_TRUE(isa<VPUser>(&Recipe));
VPRecipeBase *BaseR = &Recipe;
@@ -1039,7 +1039,7 @@ TEST(VPRecipeTest, CastVPWidenMemoryRecipeToVPUserAndVPDef) {
IntegerType *Int32 = IntegerType::get(C, 32);
PointerType *Int32Ptr = PointerType::get(Int32, 0);
auto *Load =
- new LoadInst(Int32, UndefValue::get(Int32Ptr), "", false, Align(1));
+ new LoadInst(Int32, PoisonValue::get(Int32Ptr), "", false, Align(1));
VPValue Addr;
VPValue Mask;
VPWidenLoadRecipe Recipe(*Load, &Addr, &Mask, true, false, {});
@@ -1062,8 +1062,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
PointerType *Int32Ptr = PointerType::get(Int32, 0);
{
- auto *AI = BinaryOperator::CreateAdd(UndefValue::get(Int32),
- UndefValue::get(Int32));
+ auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
SmallVector<VPValue *, 2> Args;
@@ -1078,8 +1078,9 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
}
{
- auto *SelectI = SelectInst::Create(
- UndefValue::get(Int1), UndefValue::get(Int32), UndefValue::get(Int32));
+ auto *SelectI =
+ SelectInst::Create(PoisonValue::get(Int1), PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
VPValue Op3;
@@ -1096,8 +1097,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
}
{
- auto *GEP = GetElementPtrInst::Create(Int32, UndefValue::get(Int32Ptr),
- UndefValue::get(Int32));
+ auto *GEP = GetElementPtrInst::Create(Int32, PoisonValue::get(Int32Ptr),
+ PoisonValue::get(Int32));
VPValue Op1;
VPValue Op2;
SmallVector<VPValue *, 4> Args;
@@ -1134,7 +1135,7 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
{
auto *Load =
- new LoadInst(Int32, UndefValue::get(Int32Ptr), "", false, Align(1));
+ new LoadInst(Int32, PoisonValue::get(Int32Ptr), "", false, Align(1));
VPValue Addr;
VPValue Mask;
VPWidenLoadRecipe Recipe(*Load, &Addr, &Mask, true, false, {});
@@ -1146,8 +1147,8 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
}
{
- auto *Store = new StoreInst(UndefValue::get(Int32),
- UndefValue::get(Int32Ptr), false, Align(1));
+ auto *Store = new StoreInst(PoisonValue::get(Int32),
+ PoisonValue::get(Int32Ptr), false, Align(1));
VPValue Addr;
VPValue Mask;
VPValue StoredV;
@@ -1242,8 +1243,8 @@ TEST(VPRecipeTest, dumpRecipeInPlan) {
LLVMContext C;
IntegerType *Int32 = IntegerType::get(C, 32);
- auto *AI =
- BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
+ auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
AI->setName("a");
SmallVector<VPValue *, 2> Args;
VPValue *ExtVPV1 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 1));
@@ -1296,8 +1297,8 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
LLVMContext C;
IntegerType *Int32 = IntegerType::get(C, 32);
- auto *AI =
- BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
+ auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
AI->setName("a");
SmallVector<VPValue *, 2> Args;
VPValue *ExtVPV1 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 1));
@@ -1377,8 +1378,8 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesNotInPlanOrBlock) {
LLVMContext C;
IntegerType *Int32 = IntegerType::get(C, 32);
- auto *AI =
- BinaryOperator::CreateAdd(UndefValue::get(Int32), UndefValue::get(Int32));
+ auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
+ PoisonValue::get(Int32));
AI->setName("a");
VPValue *ExtVPV1 = new VPValue(ConstantInt::get(Int32, 1));
VPValue *ExtVPV2 = new VPValue(AI);
More information about the llvm-commits
mailing list