[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
Thu Feb 1 07:32:21 PST 2024


================
@@ -2770,15 +2770,31 @@ bool llvm::replaceAllDbgUsesWith(Instruction &From, Value &To,
   return false;
 }
 
+void llvm::handleUnreachableTerminator(Instruction *I) {
+  // RemoveDIs: erase debug-info on this instruction manually.
+  I->dropDbgValues();
+  unsigned Opcode = I->getOpcode();
+  if (Opcode >= Instruction::Ret && Opcode <= Instruction::Invoke &&
----------------
nikic wrote:

Why do we need this opcode check?

https://github.com/llvm/llvm-project/pull/78444


More information about the llvm-commits mailing list