The execution command (which I used in April) is: mlir-cpu-runner -O3 -e abc -entry-point-result=void -shared-libs=./externc.so xxx.mlir
I have also tried: mlir-cpu-runner -O3 -e=abc -entry-point-result=void -shared-libs=./externc.so xxx.mlir
The output is in both cases: Error: entry point not found
What is the problem?
Note: the externc.so library contains the implementation of print_int. You can simply comment the function call to print_int and remove the --shared option to mlir-cpu-runner. The error message is the same…
I have changed abc->main in both xxx.mlir and in the command line.
Same error. I have also tried without the “-e” option, hoping “main” is a default choice.
BTW, here is my LLVM build version (about 1 month old, I think):
LLVM (http://llvm.org/):
LLVM version 12.0.0git
Optimized build with assertions.
Default target: x86_64-apple-darwin19.3.0
Host CPU: haswell
Regarding the lowering, mlir-cpu-runner used to work on standard dialect, then on standard functions with LLVM dialect inside, but it has been migrated to only work with the LLVM dialect. It looks for an llvm.func op with the entry point symbol.
The conversion process may fail, e.g., if the function signature contains an unsupported type such as tensor, at which point the standard function will persist in the IR and will not be found by the runner. The conversion is partial and non-destructive, meaning mlir-opt won’t fail if there have been failures in converting some functions, but just skip them.