[llvm] b79575d - PHINode::removeIncomingValue: use poison as a placeholder instead of undef when the PHI is dead [NFC]

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 26 10:51:08 PDT 2022


Author: Nuno Lopes
Date: 2022-06-26T18:51:02+01:00
New Revision: b79575d456624a6e08b6eeb2d6561dc7e49b3611

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

LOG: PHINode::removeIncomingValue: use poison as a placeholder instead of undef when the PHI is dead [NFC]

Added: 
    

Modified: 
    llvm/lib/IR/Instructions.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 22e8ca70c0a6a..6a91edb75dd2e 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -128,7 +128,7 @@ Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
   // If the PHI node is dead, because it has zero entries, nuke it now.
   if (getNumOperands() == 0 && DeletePHIIfEmpty) {
     // If anyone is using this PHI, make them use a dummy value instead...
-    replaceAllUsesWith(UndefValue::get(getType()));
+    replaceAllUsesWith(PoisonValue::get(getType()));
     eraseFromParent();
   }
   return Removed;


        


More information about the llvm-commits mailing list