[Mlir-commits] [mlir] [mlir][emitc] Add a `declare_func` operation (PR #80297)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 1 09:50:04 PST 2024


https://github.com/AlexDenisov commented:

That's a great and much needed feature. I used some terrible workarounds to achieve the same, and ended up using `VerbatimOp`.

I'd add a test case for when the prototype is emitted inside the function body as well.

It looks like this feature would be incomplete without support of external functions (`mlir::func::FuncOp` which are only declaring the functions).
I'd expect [this case](https://github.com/llvm/llvm-project/blob/e7d40a87ff230528131541f6ac17a2e1a7dc78e1/mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp#L60-L62) to naturally map to this operation? Otherwise the use case is rather limited.

https://github.com/llvm/llvm-project/pull/80297


More information about the Mlir-commits mailing list