[PATCH] D79184: [MLIR][LoopOps] Adds the loop unroll transformation for loop::ForOp.

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 00:57:43 PDT 2020


bondhugula requested changes to this revision.
bondhugula added inline comments.
This revision now requires changes to proceed.


================
Comment at: mlir/lib/Transforms/Utils/LoopUtils.cpp:195
+/// it can be determined that the loop has a single iteration.
+LogicalResult mlir::promoteIfSingleIteration(loop::ForOp forOp) {
+  auto lbCstOp =
----------------
I don't think you need a separate method. Just change the promoteIfSingleIteration to work on LoopLikeOp. You'll just need to add a new getLowerBound interface method (pass the builder for it to create an affine.apply if necessary). The rest like getConstantTripCount / getConstantLowerBound are all already there or easy to add. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79184/new/

https://reviews.llvm.org/D79184





More information about the llvm-commits mailing list