[llvm] 509af08 - replace 2 placeholder uses of undef with poison [NFC]

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 01:01:47 PDT 2024


Author: Nuno Lopes
Date: 2024-10-24T09:01:25+01:00
New Revision: 509af087cccca3bf8a90bc9871335224226dc6fe

URL: https://github.com/llvm/llvm-project/commit/509af087cccca3bf8a90bc9871335224226dc6fe
DIFF: https://github.com/llvm/llvm-project/commit/509af087cccca3bf8a90bc9871335224226dc6fe.diff

LOG: replace 2 placeholder uses of undef with poison [NFC]

Added: 
    

Modified: 
    llvm/lib/CodeGen/CodeGenPrepare.cpp
    llvm/lib/CodeGen/SjLjEHPrepare.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 86f28293ba9ff8..67a35901511417 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -3340,7 +3340,7 @@ class TypePromotionTransaction {
         // Set a dummy one.
         // We could use OperandSetter here, but that would imply an overhead
         // that we are not willing to pay.
-        Inst->setOperand(It, UndefValue::get(Val->getType()));
+        Inst->setOperand(It, PoisonValue::get(Val->getType()));
       }
     }
 

diff  --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index c4ad9f0b2172fc..c10c74011955a1 100644
--- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -267,11 +267,11 @@ void SjLjEHPrepareImpl::lowerIncomingArguments(Function &F) {
 
     Type *Ty = AI.getType();
 
-    // Use 'select i8 true, %arg, undef' to simulate a 'no-op' instruction.
+    // Use 'select i8 true, %arg, poison' to simulate a 'no-op' instruction.
     Value *TrueValue = ConstantInt::getTrue(F.getContext());
-    Value *UndefValue = UndefValue::get(Ty);
+    Value *PoisonValue = PoisonValue::get(Ty);
     Instruction *SI = SelectInst::Create(
-        TrueValue, &AI, UndefValue, AI.getName() + ".tmp", AfterAllocaInsPt);
+        TrueValue, &AI, PoisonValue, AI.getName() + ".tmp", AfterAllocaInsPt);
     AI.replaceAllUsesWith(SI);
 
     // Reset the operand, because it  was clobbered by the RAUW above.


        


More information about the llvm-commits mailing list