From b51c6130efac2afd183ad71b81c16c713c10a1b5 Mon Sep 17 00:00:00 2001 From: Manuel Brito Date: Sat, 10 Sep 2022 14:22:38 +0100 Subject: 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 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp') 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. -- cgit v1.1