aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.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/BasicBlockUtils.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/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index b08bf48..e3cb5f3 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -80,7 +80,7 @@ void llvm::detachDeadBlocks(
// contained within it must dominate their uses, that all uses will
// eventually be removed (they are themselves dead).
if (!I.use_empty())
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
+ I.replaceAllUsesWith(PoisonValue::get(I.getType()));
BB->getInstList().pop_back();
}
new UnreachableInst(BB->getContext(), BB);
@@ -1142,7 +1142,7 @@ SplitBlockPredecessorsImpl(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
if (Preds.empty()) {
// Insert dummy values as the incoming value.
for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I)
- cast<PHINode>(I)->addIncoming(UndefValue::get(I->getType()), NewBB);
+ cast<PHINode>(I)->addIncoming(PoisonValue::get(I->getType()), NewBB);
}
// Update DominatorTree, LoopInfo, and LCCSA analysis information.