Hi all,
I’m experimenting with the MLIR C API. Getting traction finally:
module {
func @__match(%arg0: !llvm.ptr<i8>, %arg1: !llvm.ptr<i8>) -> i32 {
}
}
I’d like to rename %arg0 and %arg1 to %str and %pattern:
module {
func @__match(%str: !llvm.ptr<i8>, %pattern: !llvm.ptr<i8>) -> i32 {
}
}
MLIR Reference documentation and tests get you far:
MlirNamedAttribute funcAttrs[] = {
mlirNamedAttributeGet(
mlirIdentifierGet(ctx, mlirStringRefCreateFromCString("type")),
funcTypeAttr),
mlirNamedAttributeGet(
mlirIdentifierGet(ctx, mlirStringRefCreateFromCString("sym_name")),
funcNameAttr)};
MlirOperationState funcState =
mlirOperationStateGet(mlirStringRefCreateFromCString("func"), location);
mlirOperationStateAddOwnedRegions(&funcState, 1, &funcBodyRegion);
mlirOperationStateAddAttributes(&funcState, 2, funcAttrs);
MlirOperation func = mlirOperationCreate(&funcState);
Except there is no clear path to naming arguments.
Is there an API I’m missing? I’m behind on the nuanced design aspects of MLIR. Are dialects used to solve this problem?
regards,
Arun