Skip to content

Commit 2e1cc52

Browse files
committed
[StructurizeCFG] Use poison instead of undef as placeholder
Create dummy phi nodes with a `poison` operand instead of `undef`.
1 parent fc2cc01 commit 2e1cc52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/StructurizeCFG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,8 @@ void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) {
686686
/// Add a dummy PHI value as soon as we knew the new predecessor
687687
void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) {
688688
for (PHINode &Phi : To->phis()) {
689-
Value *Undef = UndefValue::get(Phi.getType());
690-
Phi.addIncoming(Undef, From);
689+
Value *Poison = PoisonValue::get(Phi.getType());
690+
Phi.addIncoming(Poison, From);
691691
}
692692
AddedPhis[To].push_back(From);
693693
}

0 commit comments

Comments
 (0)