[llvm] df9f479 - [IR] Use poison instead of undef for self-referential phi

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:50:00 PDT 2024


Author: Nikita Popov
Date: 2024-06-24T16:49:52+02:00
New Revision: df9f4792f55d63d77f45786a6b3c0955d2180e9e

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

LOG: [IR] Use poison instead of undef for self-referential phi

Added: 
    

Modified: 
    llvm/lib/IR/Instructions.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 2e1fd2a96ffff..f6f3876efdea4 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -205,7 +205,7 @@ Value *PHINode::hasConstantValue() const {
       ConstantValue = getIncomingValue(i);
     }
   if (ConstantValue == this)
-    return UndefValue::get(getType());
+    return PoisonValue::get(getType());
   return ConstantValue;
 }
 


        


More information about the llvm-commits mailing list