[Mlir-commits] [mlir] [mlir-runner] Check entry function not has inputs (PR #136825)

Mehdi Amini llvmlistbot at llvm.org
Mon Apr 28 01:36:58 PDT 2025


================
@@ -222,9 +222,13 @@ static Error compileAndExecuteVoidFunction(
     CompileAndExecuteConfig config, std::unique_ptr<llvm::TargetMachine> tm) {
   auto mainFunction = dyn_cast_or_null<LLVM::LLVMFuncOp>(
       SymbolTable::lookupSymbolIn(module, entryPoint));
-  if (!mainFunction || mainFunction.empty())
+  if (!mainFunction || mainFunction.isExternal())
     return makeStringError("entry point not found");
 
+  if (cast<LLVM::LLVMFunctionType>(mainFunction.getFunctionType())
+          .getNumParams() != 0)
+    return makeStringError("function inputs not supported");
----------------
joker-eph wrote:

```suggestion
    return makeStringError("JIT can't invoke a main function expecting arguments");
```

Somehow the errors in this file seem a bit short on description.

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


More information about the Mlir-commits mailing list