[Mlir-commits] [mlir] [mlir][Inliner] Fix crash when inlining callee without terminator (PR #173665)

Matthias Springer llvmlistbot at llvm.org
Sat Dec 27 00:57:18 PST 2025


================
@@ -682,7 +682,14 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
     useList.mergeUsesAfterInlining(it.targetNode, it.sourceNode);
 
     // then erase the call.
-    call.erase();
+    if (call.getOperation()->use_empty()) {
+      call.erase();
+    } else {
+      LDBG() << "CallOpInterface is still in use. call = " << call
+             << " returning failure";
+      call->emitError("not all uses of call were replaced");
----------------
matthias-springer wrote:

Do we understand the reason why this is happening? Is this a bug or an expected error?

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


More information about the Mlir-commits mailing list