[Mlir-commits] [mlir] [mlir][transforms] Fix crash in remove-dead-values when function has non-call users (PR #183655)

Mehdi Amini llvmlistbot at llvm.org
Fri Feb 27 02:30:43 PST 2026


================
@@ -302,7 +302,11 @@ static void processFuncOp(FunctionOpInterface funcOp, Operation *module,
   SymbolTable::UseRange uses = *funcOp.getSymbolUses(module);
   for (SymbolTable::SymbolUse use : uses) {
     Operation *callOp = use.getUser();
-    assert(isa<CallOpInterface>(callOp) && "expected a call-like user");
+    // If a non-call operation references the function (e.g. spirv.EntryPoint),
+    // we cannot safely remove arguments or return values since we don't know
+    // what the user expects. Skip this function entirely.
+    if (!isa<CallOpInterface>(callOp))
+      return;
----------------
joker-eph wrote:

Oh right, updated, and adjusted the test to stress case this as well!

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


More information about the Mlir-commits mailing list