[PATCH] D75052: [MLIR][GPU] Properly model step in parallel loop to gpu conversion.
Alex Zinenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 04:24:38 PST 2020
ftynse accepted this revision.
ftynse added inline comments.
This revision is now accepted and ready to land.
================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:537
Value constantBound = {};
if (AffineMinOp minOp =
dyn_cast_or_null<AffineMinOp>(upperBound.getDefiningOp())) {
----------------
Nit: could you early-return instead?
================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:655
+ // affine expression ceilDiv (upperBound - lowerBound) step. We use
+ // affine here so that it composes nicely with the provided map.
+ AffineMap stepMap =
----------------
Nit "we use affine apply" ?
================
Comment at: mlir/test/Conversion/LoopsToGPU/parallel_loop.mlir:18
-// CHECK: #map0 = affine_map<(d0) -> (d0)>
-// CHECK: module {
+// CHECK: #map0 = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
----------------
Let's not match on attribute names here, i.e. prefer `#[[MAP0:.*]] = affine_map<...`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75052/new/
https://reviews.llvm.org/D75052
More information about the llvm-commits
mailing list