Skip to content

Commit 73f651f

Browse files
authored
[MLIR][ExecutionEngine] don't dump decls
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).
1 parent c208a23 commit 73f651f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ ExecutionEngine::create(Operation *m, const ExecutionEngineOptions &options,
239239
// Remember all entry-points if object dumping is enabled.
240240
if (options.enableObjectDump) {
241241
for (auto funcOp : m->getRegion(0).getOps<LLVM::LLVMFuncOp>()) {
242+
if (funcOp.getBlocks().empty())
243+
continue;
242244
StringRef funcName = funcOp.getSymName();
243245
engine->functionNames.push_back(funcName.str());
244246
}

0 commit comments

Comments
 (0)