aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorManuel Brito <manuel.brito@tecnico.ulisboa.pt>2022-09-10 14:22:38 +0100
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>2022-09-10 14:28:01 +0100
commitb51c6130efac2afd183ad71b81c16c713c10a1b5 (patch)
tree31bac9c96436b6884a3b6ba8e676e18a6f677460 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parentbc0725a43763ff241f807e1de45d1a548aec89b8 (diff)
downloadllvm-b51c6130efac2afd183ad71b81c16c713c10a1b5.zip
llvm-b51c6130efac2afd183ad71b81c16c713c10a1b5.tar.gz
llvm-b51c6130efac2afd183ad71b81c16c713c10a1b5.tar.bz2
Use PoisonValue instead of UndefValue when RAUWing unreachable code [NFC]
Replacing the following instances of UndefValue with PoisonValue, where the UndefValue is used as an arbitrary value: - llvm/lib/CodeGen/WinEHPrepare.cpp `demotePHIsOnFunclets`: RAUW arbitrary value for lingering uses of removed PHI nodes - llvm/lib/Transforms/Utils/BasicBlockUtils.cpp `FoldSingleEntryPHINodes`: Removes a self-referential single entry phi node. - llvm/lib/Transforms/Utils/CallGraphUpdater.cpp `finalize`: Remove all references to removed functions. - llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp `cleanup`: the result is not used then the inserted instructions are removed. - llvm/tools/bugpoint/CrashDebugger.cpp `TestInts`: the program is cloned and instructions are removed to narrow down source of crash. Differential Revision: https://reviews.llvm.org/D133640
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 9ab8014..746fe79 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -149,7 +149,7 @@ bool llvm::FoldSingleEntryPHINodes(BasicBlock *BB,
if (PN->getIncomingValue(0) != PN)
PN->replaceAllUsesWith(PN->getIncomingValue(0));
else
- PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
+ PN->replaceAllUsesWith(PoisonValue::get(PN->getType()));
if (MemDep)
MemDep->removeInstruction(PN); // Memdep updates AA itself.