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

Andy Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 08:22:28 PDT 2020


andydavis1 marked an inline comment as done.
andydavis1 added inline comments.


================
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 =
----------------
bondhugula wrote:
> 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. 
Thanks. Yes, I agree that we can do more code sharing by moving these changes towards a LoopLike interface kind of a thing (I mentioned that a bit in the description). But if possible, I'd like to do that in a follow up change, as its not a simple as switching loop::ForOp to LoopLikeOp, and I'd like to minimize the changes in this patch. Thanks.


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