[llvm] 9865296 - [StructurizeCFG] Use `poison` instead of `undef` as placeholder [NFC] (#119137)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 07:03:48 PST 2024


Author: Pedro Lobo
Date: 2024-12-10T15:03:44Z
New Revision: 986529634368d99a3b469033d84e45a62d53eec5

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

LOG: [StructurizeCFG] Use `poison` instead of `undef` as placeholder [NFC] (#119137)

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/StructurizeCFG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
index 01090b54e5afa3..b1f742b838f2a1 100644
--- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -686,8 +686,8 @@ void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) {
 /// Add a dummy PHI value as soon as we knew the new predecessor
 void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) {
   for (PHINode &Phi : To->phis()) {
-    Value *Undef = UndefValue::get(Phi.getType());
-    Phi.addIncoming(Undef, From);
+    Value *Poison = PoisonValue::get(Phi.getType());
+    Phi.addIncoming(Poison, From);
   }
   AddedPhis[To].push_back(From);
 }


        


More information about the llvm-commits mailing list