aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>2022-07-23 21:50:11 +0100
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>2022-07-23 21:50:11 +0100
commit9df0b254d24eca0987d9f88e998b4432f8608ff2 (patch)
tree259a82abacdecc595ac435c46d1391803b532053 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parent2d2e2e7ea960c678416862f4b70215f0de16f39a (diff)
downloadllvm-9df0b254d24eca0987d9f88e998b4432f8608ff2.zip
llvm-9df0b254d24eca0987d9f88e998b4432f8608ff2.tar.gz
llvm-9df0b254d24eca0987d9f88e998b4432f8608ff2.tar.bz2
[NFC] Switch a few uses of undef to poison as placeholders for unreachable code
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index e737a594..1d34821 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -734,14 +734,14 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
}
// If the loops above have made these phi nodes have 0 or 1 operand,
- // replace them with undef or the input value. We must do this for
+ // replace them with poison or the input value. We must do this for
// correctness, because 0-operand phis are not valid.
PN = cast<PHINode>(NewBB->begin());
if (PN->getNumIncomingValues() == 0) {
BasicBlock::iterator I = NewBB->begin();
BasicBlock::const_iterator OldI = OldBB->begin();
while ((PN = dyn_cast<PHINode>(I++))) {
- Value *NV = UndefValue::get(PN->getType());
+ Value *NV = PoisonValue::get(PN->getType());
PN->replaceAllUsesWith(NV);
assert(VMap[&*OldI] == PN && "VMap mismatch");
VMap[&*OldI] = NV;