14#ifndef AIE_DIALECT_AIEX_UTILS_DMADECOMPOSITION_H
15#define AIE_DIALECT_AIEX_UTILS_DMADECOMPOSITION_H
17#include "mlir/IR/BuiltinTypes.h"
18#include "mlir/IR/Operation.h"
19#include "mlir/Support/LogicalResult.h"
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/SmallVector.h"
32static constexpr unsigned kNdDmaDims = 4;
37static constexpr int64_t kMaxNdDmaPieces = 1024;
46 llvm::SmallVector<int64_t, kNdDmaDims>
offsets;
47 llvm::SmallVector<int64_t, kNdDmaDims>
sizes;
48 llvm::SmallVector<int64_t, kNdDmaDims>
strides;
59 mlir::BaseMemRefType referencedBufType,
61 int tileCol,
int tileRow,
63 bool skipTransformationChecks =
false);
68 mlir::BaseMemRefType referencedBufType,
70 int tileCol,
int tileRow,
71 llvm::ArrayRef<int64_t> offsetsInnermostFirst,
72 llvm::ArrayRef<int64_t> sizesInnermostFirst,
73 llvm::ArrayRef<int64_t> stridesInnermostFirst);
91 mlir::Operation *forOp, mlir::BaseMemRefType referencedBufType,
93 int tileCol,
int tileRow);
109mlir::FailureOr<TaskBdDecomposition>
112 int tileCol,
int tileRow);
bool isDecomposableNdDmaPattern(mlir::Operation *forOp, mlir::BaseMemRefType referencedBufType, const xilinx::AIE::AIETargetModel &targetModel, int tileCol, int tileRow, llvm::ArrayRef< int64_t > offsetsInnermostFirst, llvm::ArrayRef< int64_t > sizesInnermostFirst, llvm::ArrayRef< int64_t > stridesInnermostFirst)
True when the pattern is fully constant, non-contiguous, currently illegal, and decomposeNdDmaPattern...
mlir::FailureOr< llvm::SmallVector< NdDmaPattern > > decomposeNdDmaPattern(mlir::Operation *forOp, mlir::BaseMemRefType referencedBufType, const NdDmaPattern &pattern, const xilinx::AIE::AIETargetModel &targetModel, int tileCol, int tileRow)
Decompose an illegal pattern into one or more legal sub-patterns that move the same data.
mlir::FailureOr< TaskBdDecomposition > decomposeTaskBdPattern(xilinx::AIE::DMABDOp bd, const xilinx::AIE::AIETargetModel &targetModel, int tileCol, int tileRow)
Plan the split of bd, a runtime task's descriptor, on tile (tileCol, tileRow).
bool patternPassesVerification(mlir::Operation *forOp, mlir::BaseMemRefType referencedBufType, const xilinx::AIE::AIETargetModel &tm, int tileCol, int tileRow, const NdDmaPattern &pattern, bool skipTransformationChecks=false)
Returns true when the pattern passes verifyStridesWraps for the given tile and memref element type.
Innermost-first ND access pattern (d0..d3 / repeat), matching the convention used by verifyStridesWra...
llvm::SmallVector< int64_t, kNdDmaDims > sizes
int64_t baseOffset
Elements added to the address the offsets give.
llvm::SmallVector< int64_t, kNdDmaDims > offsets
llvm::SmallVector< int64_t, kNdDmaDims > strides
How aie-decompose-large-dma-bd splits a runtime task's descriptor.
bool legal
The descriptor lowers as it is.
llvm::SmallVector< NdDmaPattern > pieces
The legal patterns pass splits into; empty when no split fits.
NdDmaPattern pass
One pass over the descriptor, less the outer dimensions that only re-read the same data.