Extend loop unroll/unroll-and-jam to affine bounds + refactor related code.
authorUday Bondhugula <bondhugula@google.com>
Tue, 18 Sep 2018 17:22:03 +0000 (10:22 -0700)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 20:15:06 +0000 (13:15 -0700)
commitab4797229c399fafeb940adc59231fa181fdae1c
tree308490cca2153c14bd4e430f91ce2b4003284224
parent7103779fb84afa65ce9fdc18ce11462c88235200
Extend loop unroll/unroll-and-jam to affine bounds + refactor related code.

- extend loop unroll-jam similar to loop unroll for affine bounds
- extend both loop unroll/unroll-jam to deal with cleanup loop for non multiple
  of unroll factor.
- extend promotion of single iteration loops to work with affine bounds
- fix typo bugs in loop unroll
- refactor common code b/w loop unroll and loop unroll-jam
- move prototypes of non-pass transforms to LoopUtils.h
- add additional builder methods.
- introduce loopUnrollUpTo(factor) to unroll by either factor or trip count,
  whichever is less.
- remove Statement::isInnermost (not used for now - will come back at the right
  place/in right form later)

PiperOrigin-RevId: 213471227
14 files changed:
mlir/include/mlir/Analysis/LoopAnalysis.h
mlir/include/mlir/IR/Builders.h
mlir/include/mlir/IR/Statement.h
mlir/include/mlir/IR/Statements.h
mlir/include/mlir/Transforms/LoopUtils.h [new file with mode: 0644]
mlir/include/mlir/Transforms/Passes.h
mlir/lib/Analysis/LoopAnalysis.cpp
mlir/lib/IR/Builders.cpp
mlir/lib/IR/Statement.cpp
mlir/lib/Transforms/LoopUnroll.cpp
mlir/lib/Transforms/LoopUnrollAndJam.cpp
mlir/lib/Transforms/LoopUtils.cpp
mlir/test/Transforms/unroll-jam.mlir
mlir/test/Transforms/unroll.mlir