[llvm] [InstCombine] If inst in unreachable refers to an inst change it to poison (#65107) (PR #78444)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 08:14:45 PST 2024
================
@@ -2762,15 +2762,30 @@ bool llvm::replaceAllDbgUsesWith(Instruction &From, Value &To,
return false;
}
+bool llvm::handleUnreachableTerminator(Instruction *I) {
+ bool Changed = false;
+ // RemoveDIs: erase debug-info on this instruction manually.
+ I->dropDbgValues();
+ for (Use &U : I->operands()) {
+ Value *Op = U.get();
+ if (isa<Instruction>(Op) && !Op->getType()->isTokenTy()) {
----------------
nikic wrote:
Nope :) You are right, checking poison is unnecessary.
https://github.com/llvm/llvm-project/pull/78444
More information about the llvm-commits
mailing list