[Mlir-commits] [mlir] [mlir][EmitC]Expand the MemRefToEmitC pass - Lowering `AllocOp` (PR #148257)

Gil Rapaport llvmlistbot at llvm.org
Tue Jul 22 08:02:59 PDT 2025


================
@@ -30,6 +30,16 @@ struct ConvertMemRefToEmitCPass
     : public impl::ConvertMemRefToEmitCBase<ConvertMemRefToEmitCPass> {
   void runOnOperation() override {
     TypeConverter converter;
+    mlir::ModuleOp module = getOperation();
+    module.walk([&](mlir::Operation *op) {
+      if (llvm::isa<mlir::memref::AllocOp, mlir::memref::CopyOp>(op)) {
----------------
aniragil wrote:

Worth also checking existing `emitc.include` directives to avoid double inclusion (admittedly harmless beyond some wasting C compilation time).

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


More information about the Mlir-commits mailing list