[MLIR][LoopOps] Adds the loop unroll transformation for loop::ForOp.
authorAndy Davis <andydavis@google.com>
Tue, 5 May 2020 17:29:09 +0000 (10:29 -0700)
committerAndy Davis <andydavis@google.com>
Tue, 5 May 2020 17:42:36 +0000 (10:42 -0700)
commit93d1108801ddfe3d5e68296cdc62e44b3382e31e
tree6bb4b69ce41a009abf7039460d54d7ca8726d4f0
parent6bb68fdd05914d1fa1687c1c33fbb9b2ea2611d1
[MLIR][LoopOps] Adds the loop unroll transformation for loop::ForOp.

Summary:
Adds the loop unroll transformation for loop::ForOp.
Adds support for promoting the body of single-iteration loop::ForOps into its containing block.
Adds check tests for loop::ForOps with dynamic and static lower/upper bounds and step.
Care was taken to share code (where possible) with the AffineForOp unroll transformation to ease maintenance and potential future transition to a LoopLike construct on which loop transformations for different loop types can implemented.

Reviewers: ftynse, nicolasvasilache

Reviewed By: ftynse

Subscribers: bondhugula, mgorny, zzheng, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79184
mlir/include/mlir/Transforms/LoopUtils.h
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/test/Dialect/Loops/loop-unroll.mlir [new file with mode: 0644]
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestLoopUnrolling.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/mlir-opt.cpp