[Mlir-commits] [mlir] Expand the MemRefToEmitC pass - Lowering `AllocOp` (PR #148257)
Gil Rapaport
llvmlistbot at llvm.org
Wed Jul 16 10:01:46 PDT 2025
================
@@ -77,6 +77,43 @@ struct ConvertAlloca final : public OpConversionPattern<memref::AllocaOp> {
}
};
+struct ConvertAlloc final : public OpConversionPattern<memref::AllocOp> {
+ using OpConversionPattern::OpConversionPattern;
+ LogicalResult
+ matchAndRewrite(memref::AllocOp allocOp, OpAdaptor operands,
----------------
aniragil wrote:
The `malloc()` function requires including the relevant header file ("stdlib.h" for C, "cstdlib.h" for C++). The pass would have to add to the module such an `emitc.include` op to the module or a forward declaration of `malloc()` using `emitc.declare_func` (in which case it can use `emitc.call` instead of `emitc.call_opaque`).
https://github.com/llvm/llvm-project/pull/148257
More information about the Mlir-commits
mailing list