Extend loop unrolling and unroll-jamming to non-matching bound operands and
authorUday Bondhugula <bondhugula@google.com>
Tue, 12 Mar 2019 15:00:52 +0000 (08:00 -0700)
committerjpienaar <jpienaar@google.com>
Sat, 30 Mar 2019 00:14:12 +0000 (17:14 -0700)
commit075090f89120c8780482ded9f5c2a98c0fd0d0ba
treec33d00475a60bd9bb42d7a67062c7b3bb3dd1e2c
parent9abea4a466c3362562eee85fcf6795829099e285
Extend loop unrolling and unroll-jamming to non-matching bound operands and
multi-result upper bounds, complete TODOs, fix/improve test cases.

- complete TODOs for loop unroll/unroll-and-jam. Something as simple as
  "for %i = 0 to %N" wasn't being unrolled earlier (unless it had been written
  as "for %i = ()[s0] -> (0)()[%N] to %N"; addressed now.

- update/replace getTripCountExpr with buildTripCountMapAndOperands; makes it
  more powerful as it composes inputs into it

- getCleanupLowerBound and getUnrolledLoopUpperBound actually needed the same
  code; refactor and remove one.

- reorganize test cases, write previous ones better; most of these changes are
  "label replacements".

- fix wrongly labeled test cases in unroll-jam.mlir

PiperOrigin-RevId: 238014653
mlir/include/mlir/Analysis/LoopAnalysis.h
mlir/include/mlir/Transforms/LoopUtils.h
mlir/lib/Analysis/LoopAnalysis.cpp
mlir/lib/Transforms/LoopUnrollAndJam.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/test/Transforms/unroll-jam.mlir
mlir/test/Transforms/unroll.mlir