Hi all,
My experience is limited to LLVM CAPI and I’m new to MLIR. In my experience (very short), if mlir-opt
passes the input mlir then mlir-translate
will generate the final IR.
In my exemplar I’m calling regcomp from MLIR CAPI (12.0.1). See my reproducer below (mlir-opt -convert-std-to-llvm
):
module attributes {llvm.data_layout = ""} {
llvm.func @__match(%arg0: !llvm.ptr<i8>, %arg1: !llvm.ptr<i8>) -> i32 attributes {arg_attrs = [{llvm.name = "str"}, {llvm.name = "pattern"}]} {
%0 = llvm.mlir.null : !llvm.ptr<struct<"regex_t", (i32, i32, ptr<i8>, ptr<struct<"re_guts", opaque>>)>>
%1 = llvm.mlir.constant(0 : i32) : i32
llvm.call @regcomp(%0, %arg1, %1) : (!llvm.ptr<struct<"regex_t", (i32, i32, ptr<i8>, ptr<struct<"re_guts", opaque>>)>>, !llvm.ptr<i8>, i32) -> ()
%2 = llvm.mlir.constant(1 : i32) : i32
llvm.return %2 : i32
}
llvm.func @regcomp(!llvm.ptr<struct<"regex_t", (i32, i32, ptr<i8>, ptr<struct<"re_guts", opaque>>)>>, !llvm.ptr<i8>, i32) -> i32
}
However if I run this reproducer through mlir-translate --mlir-to-llvmir
I don’t get any LLVM IR. I suspect the issue is the llvm.call
and it’s arguments but mlir-opt
doesn’t complain.
regards,
Arun