[Mlir-commits] [mlir] Print region argument only when sufficient number of args are present in body (PR #133167)

Mehdi Amini llvmlistbot at llvm.org
Thu Mar 27 13:53:28 PDT 2025


================
@@ -118,7 +118,8 @@ void call_interface_impl::printFunctionSignature(
       ArrayRef<NamedAttribute> attrs;
       if (argAttrs)
         attrs = llvm::cast<DictionaryAttr>(argAttrs[i]).getValue();
-      p.printRegionArgument(body->getArgument(i), attrs);
+      if (body->getNumArguments() > i)
+        p.printRegionArgument(body->getArgument(i), attrs);
----------------
joker-eph wrote:

I don't quite understand this case: is it that the function signature does not match the number of arguments for the body? Seems to me like this is invalid IR and your print is just incorrect. We should have a verifier instead.

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


More information about the Mlir-commits mailing list