onnx-mlir
onnx-mlir copied to clipboard
[Question] Why do we need C wrapper emission attribute?
https://github.com/onnx/onnx-mlir/blob/32d2c8b6c2f41ccc917beca1df7fcca4ac378442/src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp#L864-L868
Recently I've been experimenting the pass inside this project.
The experiment involves mapping certain op into Func dialect operations, which is before ConvertKrnlToLLVM pass.
However, the reference code inject the C wrapper emission attribute for all Func declaration.
Causing the symbol name have unexpected _mlir_ciface_ prefix when lowering to LLVM dialect.
I've commented the reference code and it runs fine for my use case end to end. Any idea on why we need the C wrapper emission attribute? If remove it from project, what potential break this might been?
Thanks.
@tungld or @chentong319 any suggestions on this one?
I am not the original author of that but we can refer to this MLIR document to understand what it is: https://mlir.llvm.org/docs/TargetLLVMIR/#c-compatible-wrapper-emission