21 #define GEN_PASS_DEF_AFFINELOOPNORMALIZE
22 #include "mlir/Dialect/Affine/Passes.h.inc"
34 struct AffineLoopNormalizePass
35 :
public affine::impl::AffineLoopNormalizeBase<AffineLoopNormalizePass> {
36 explicit AffineLoopNormalizePass(
bool promoteSingleIter) {
37 this->promoteSingleIter = promoteSingleIter;
40 void runOnOperation()
override {
42 if (
auto affineParallel = dyn_cast<AffineParallelOp>(op))
44 else if (
auto affineFor = dyn_cast<AffineForOp>(op))
52 std::unique_ptr<OperationPass<func::FuncOp>>
54 return std::make_unique<AffineLoopNormalizePass>(promoteSingleIter);
Operation is the basic unit of execution within MLIR.
void normalizeAffineParallel(AffineParallelOp op)
Normalize a affine.parallel op so that lower bounds are 0 and steps are 1.
std::unique_ptr< OperationPass< func::FuncOp > > createAffineLoopNormalizePass(bool promoteSingleIter=false)
Apply normalization transformations to affine loop-like ops.
LogicalResult normalizeAffineFor(AffineForOp op, bool promoteSingleIter=false)
Normalize an affine.for op.
Include the generated interface declarations.