#ifndef PIM_BUFFERIZATION
#define PIM_BUFFERIZATION

#ifndef OP_BASE
include "mlir/IR/PatternBase.td"
include "mlir/Dialect/MemRef/IR/MemRefOps.td"
include "src/Accelerators/PIM/Dialect/Pim/Pim.td"
#endif // OP_BASE

def memrefCopyToPimMemCopyOp : Pat<
  (CopyOp $src, $dst),
  (PimMemCopyOp $dst, $src,
    ConstantAttr<I32Attr, "0">,
    ConstantAttr<I32Attr, "0">,
    (NativeCodeCall<"pim::getMemRefSizeInBytesAttr($_builder, $0)"> $src),
    (returnType $dst))
>;

#endif // PIM_BUFFERIZATION
