[Mlir-commits] [mlir] [MLIR][ExecutionEngine] don't dump decls (PR #164478)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Oct 21 12:18:20 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Maksim Levental (makslevental)
<details>
<summary>Changes</summary>
Currently ExecutionEngine tries to dump all functions declared in the module, even thoughs which "external" (i.e., linked at runtime). E.g.
```mlir
module {
func.func @<!-- -->supported_arg_types(%arg0: i32, %arg1: f32) {
vector.print %arg0 : i32
vector.print %arg1 : f32
return
}
}
```
fails with
```
Could not compile printF32:
Symbols not found: [ __mlir_printF32 ]
Program aborted due to an unhandled Error:
Symbols not found: [ __mlir_printF32 ]
```
even though `mlir_printF32` can and is provided by our own `libmlir_c_runner_utils`, which is usually loaded by the engine but of course can also be linked/loaded at runtime by whatever thing links the object file produced from the above.
So just skip functions which have no bodies during dump (i.e., are decls without defns).
---
Full diff: https://github.com/llvm/llvm-project/pull/164478.diff
1 Files Affected:
- (modified) mlir/lib/ExecutionEngine/ExecutionEngine.cpp (+2)
``````````diff
diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index 52162a43aeae3..2255633c746b3 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -239,6 +239,8 @@ ExecutionEngine::create(Operation *m, const ExecutionEngineOptions &options,
// Remember all entry-points if object dumping is enabled.
if (options.enableObjectDump) {
for (auto funcOp : m->getRegion(0).getOps<LLVM::LLVMFuncOp>()) {
+ if (funcOp.getBlocks().empty())
+ continue;
StringRef funcName = funcOp.getSymName();
engine->functionNames.push_back(funcName.str());
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/164478
More information about the Mlir-commits
mailing list