I have reduced an onnx model to LLVM IR, then when using mlpir-cpu-runner to execute, it generates the following error.
llvm-project-master/build/bin/mlir-cpu-runner llvm.mlir
loc(“llvm.mlir”:273:45): error: custom op ‘llvm.insertvalue’ expected wrapped LLVM IR structure/array type
could not parse the input IR
I suppose you mean “LLVM dialect”, not “LLVM IR”. mlir-cpu-runner won’t run LLVM IR (lli will) We need to see the IR that caused the problem. The error clearly says some insertvalue instruction is called on a value of a wrong type.
Something happened with the formatting (specifically, some * got interpreted by markdown), so I can’t see the proper types. Maybe paste it on github gist?
%7 = llvm.insertvalue %6, %4[0 : i32] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }*">
tries to call insertvalue on a pointer, rather than a structure. %4 comes from an llvm.load, so it shouldn’t be a pointer. Look into the code that constructs insertvalue that may be passing the wrong type into the constructor.