[Mlir-commits] [mlir] [mlir][EmitC] Refactor MLIR Translate To Cpp (PR #84973)
Weizhe Chen
llvmlistbot at llvm.org
Mon Mar 18 08:12:08 PDT 2024
weizchen wrote:
> I think we won't know about this if we just expose interfaces without first building a good understanding of the limits
Yeah sorry for not making this clear. So for example, the compound type I mentioned before, `<Cache_Level::L2, 2>`, it could be an exhaustive process to represent by opaque types, but if we can extend the printType function; or we add a printCustomType function and call both in the emitter, only a few lines of code can cover all the situations. This example is actually a bad example that can reveal the limitation. This is because if we are going to extend the member function in the CppEmitter class, things will get a bit messy to deal with the interface function, so a type interface is preferred in this situation to solve the problem. But with this interface, it provides a way for external dialects to register cpp translation into the emitc.
https://github.com/llvm/llvm-project/pull/84973
More information about the Mlir-commits
mailing list