[llvm] [InstCombine] If inst in unreachable refers to an inst change it to poison (#65107) (PR #78444)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 08:12:57 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()) {
----------------
ParkHanbum wrote:

ok. I have a question. when Op is Poison it can pass `isa<Instruction>(Op)` condition?

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


More information about the llvm-commits mailing list