[llvm] 68efc50 - [VectorBuilderTest] Use poison instead of undef for dummy values (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 03:57:40 PDT 2024


Author: Nikita Popov
Date: 2024-06-25T12:57:19+02:00
New Revision: 68efc506f58776fdfcfc60707f8fe52584736d8a

URL: https://github.com/llvm/llvm-project/commit/68efc506f58776fdfcfc60707f8fe52584736d8a
DIFF: https://github.com/llvm/llvm-project/commit/68efc506f58776fdfcfc60707f8fe52584736d8a.diff

LOG: [VectorBuilderTest] Use poison instead of undef for dummy values (NFC)

Added: 
    

Modified: 
    llvm/unittests/IR/VectorBuilderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/IR/VectorBuilderTest.cpp b/llvm/unittests/IR/VectorBuilderTest.cpp
index 4f9e9d7c494d9..e01378a2755f0 100644
--- a/llvm/unittests/IR/VectorBuilderTest.cpp
+++ b/llvm/unittests/IR/VectorBuilderTest.cpp
@@ -65,7 +65,7 @@ TEST_F(VectorBuilderTest, TestCreateBinaryInstructions) {
     auto VPID = VPIntrinsic::getForOpcode(Instruction::OPCODE);                \
     bool IsFP = (#INSTCLASS)[0] == 'F';                                        \
     auto *ValueTy = IsFP ? FloatVecTy : IntVecTy;                              \
-    Value *Op = UndefValue::get(ValueTy);                                      \
+    Value *Op = PoisonValue::get(ValueTy);                                      \
     auto *I = VBuild.createVectorInstruction(Instruction::OPCODE, ValueTy,     \
                                              {Op, Op});                        \
     ASSERT_TRUE(isa<VPIntrinsic>(I));                                          \
@@ -115,7 +115,7 @@ TEST_F(VectorBuilderTest, TestCreateBinaryInstructions_FixedVector_NoMask) {
     auto VPID = VPIntrinsic::getForOpcode(Instruction::OPCODE);                \
     bool IsFP = (#INSTCLASS)[0] == 'F';                                        \
     Type *ValueTy = IsFP ? FloatVecTy : IntVecTy;                              \
-    Value *Op = UndefValue::get(ValueTy);                                      \
+    Value *Op = PoisonValue::get(ValueTy);                                      \
     auto *I = VBuild.createVectorInstruction(Instruction::OPCODE, ValueTy,     \
                                              {Op, Op});                        \
     ASSERT_TRUE(isa<VPIntrinsic>(I));                                          \
@@ -161,7 +161,7 @@ TEST_F(VectorBuilderTest, TestCreateBinaryInstructions_FixedVector_NoEVL) {
     auto VPID = VPIntrinsic::getForOpcode(Instruction::OPCODE);                \
     bool IsFP = (#INSTCLASS)[0] == 'F';                                        \
     Type *ValueTy = IsFP ? FloatVecTy : IntVecTy;                              \
-    Value *Op = UndefValue::get(ValueTy);                                      \
+    Value *Op = PoisonValue::get(ValueTy);                                      \
     auto *I = VBuild.createVectorInstruction(Instruction::OPCODE, ValueTy,     \
                                              {Op, Op});                        \
     ASSERT_TRUE(isa<VPIntrinsic>(I));                                          \
@@ -196,7 +196,7 @@ TEST_F(VectorBuilderTest,
     auto VPID = VPIntrinsic::getForOpcode(Instruction::OPCODE);                \
     bool IsFP = (#INSTCLASS)[0] == 'F';                                        \
     Type *ValueTy = IsFP ? FloatVecTy : IntVecTy;                              \
-    Value *Op = UndefValue::get(ValueTy);                                      \
+    Value *Op = PoisonValue::get(ValueTy);                                      \
     auto *I = VBuild.createVectorInstruction(Instruction::OPCODE, ValueTy,     \
                                              {Op, Op});                        \
     ASSERT_TRUE(isa<VPIntrinsic>(I));                                          \
@@ -222,8 +222,8 @@ TEST_F(VectorBuilderTest, TestCreateLoadStore) {
   auto *FloatVecTy =
       FixedVectorType::get(Type::getFloatTy(Context), VectorNumElements);
 
-  Value *FloatVecPtr = UndefValue::get(Builder.getPtrTy(0));
-  Value *FloatVec = UndefValue::get(FloatVecTy);
+  Value *FloatVecPtr = PoisonValue::get(Builder.getPtrTy(0));
+  Value *FloatVec = PoisonValue::get(FloatVecTy);
 
   // vp.load
   auto LoadVPID = VPIntrinsic::getForOpcode(Instruction::Load);


        


More information about the llvm-commits mailing list