Add cheddar emitter#2994
Conversation
| int main(int argc, char** argv) { | ||
| // MLIR-to-C++ via the EmitC dialect: used as the final stage of the CHEDDAR | ||
| // backend (`scheme-to-cheddar | --cheddar-to-emitc | heir-translate | ||
| // --mlir-to-cpp`), and available standalone for any EmitC IR. |
There was a problem hiding this comment.
Looks like there's still a bit of 🤖-y bla-bla in here - I'll come back tomorrow and clean those up
| } | ||
| }; | ||
|
|
||
| // emitc::OpaqueType doesn't implement MemRefElementTypeInterface upstream, |
There was a problem hiding this comment.
I'm mildly surprised you aren't doing an array of pointers instead of an array of values.
| return mlir::emitc::LoadOp::create(b, loc, t, lvalue); | ||
| } | ||
|
|
||
| // Emit `receiver->method(out, args..., extra);`. |
There was a problem hiding this comment.
Cf. https://discourse.llvm.org/t/method-calls-in-emitc/90898 I may end up adding support for method calls so as to support OpenFHE more naturally as well
|
|
||
| // SCF/MemRef/Arith -> EmitC, used by the cheddar pipeline to lower | ||
| // bufferized loop kernels through EmitC to C++. | ||
| registerPass([]() -> std::unique_ptr<Pass> { return createSCFToEmitC(); }); |
There was a problem hiding this comment.
This doesn't have its own registration hook already because the --convert-to-emitc pass uses dialect interface registrations to handle all dialects at once. Cf. https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Conversion/ConvertToEmitC/ConvertToEmitCPatternInterface.td
I'm guessing you found this and, due to the complexity of the emitc patterns for Cheddar, you weren't able to use it?
f7d2da5 to
e2f17c7
Compare
e2f17c7 to
88a0072
Compare
Split out from #2896, follow-up to #2944