How to set function arguments when using mlir-runner?
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I don’t know how to pass arguments to mlir-runner.
```mlir
module {
func.func @func1(%arg0: f16, %arg1: tensor, %arg2: index) -> memref<17xf32> {
%c1661746278_i32 = arith.constant 1661746278 : i32
%cst = arith.constant 2.768000e+04 : f16
%c365126088_i32 = arith.constant 365126088 : i32
%true = arith.constant true
}
```
```
mlir-opt \
--arith-expand --arith-unsigned-when-equivalent --convert-vector-to-scf --convert-vector-to-llvm --finalize-memref-to-llvm --one-shot-bufferize=""dialect-filter=arith"" --convert-arith-to-llvm -convert-to-llvm \
program_7489.mlir | mlir-runner -e func1 --entry-point-result="memref<17xf32>" --shared-libs=/llvm-project-llvmorg-21.1.2/build/lib/libmlir_runner_utils.so,/llvm-project-llvmorg-21.1.2/build/lib/libmlir_c_runner_utils.so
```
```
loc("":10:3): error: Dialect `func' not found for custom op 'func.func'
could not parse the input IR
```
Contributor guide
Research direction
Start by reproducing the shown mlir-opt pipeline and mlir-runner invocation for func1, including the reported missing func dialect error. Trace the documented entry-point and argument conventions for mlir-runner, then clarify how the f16, tensor< ?xi1>, and index arguments and the memref<17xf32> result should be supplied; done means the example has an unambiguous working invocation.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100