19 #define GEN_PASS_DEF_LOOPCOALESCING
20 #include "mlir/Dialect/Affine/Passes.h.inc"
24 #define PASS_NAME "loop-coalescing"
25 #define DEBUG_TYPE PASS_NAME
31 struct LoopCoalescingPass
32 :
public affine::impl::LoopCoalescingBase<LoopCoalescingPass> {
34 void runOnOperation()
override {
35 func::FuncOp func = getOperation();
37 if (
auto scfForOp = dyn_cast<scf::ForOp>(op))
39 else if (
auto affineForOp = dyn_cast<AffineForOp>(op))
47 std::unique_ptr<OperationPass<func::FuncOp>>
49 return std::make_unique<LoopCoalescingPass>();
Operation is the basic unit of execution within MLIR.
std::unique_ptr< OperationPass< func::FuncOp > > createLoopCoalescingPass()
Creates a pass that transforms perfectly nested loops with independent bounds into a single loop.
LogicalResult coalescePerfectlyNestedAffineLoops(AffineForOp op)
Walk an affine.for to find a band to coalesce.
Include the generated interface declarations.
LogicalResult coalescePerfectlyNestedSCFForLoops(scf::ForOp op)
Walk an affine.for to find a band to coalesce.