[PATCH] D75449: [MLIR][GPU] fix loop trip count computation in LoopsToGPU
Stephan Herhut via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 2 06:56:41 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd17428d95135: [MLIR][GPU] fix loop trip count computation in LoopsToGPU (authored by herhut).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75449/new/
https://reviews.llvm.org/D75449
Files:
mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
mlir/test/Conversion/LoopsToGPU/parallel_loop.mlir
Index: mlir/test/Conversion/LoopsToGPU/parallel_loop.mlir
===================================================================
--- mlir/test/Conversion/LoopsToGPU/parallel_loop.mlir
+++ mlir/test/Conversion/LoopsToGPU/parallel_loop.mlir
@@ -15,7 +15,7 @@
return
}
-// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> ((s0 - s1) ceildiv s2)>
// CHECK: #[[MAP1:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
// CHECK: module {
@@ -66,7 +66,7 @@
return
}
-// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> ((s0 - s1) ceildiv s2)>
// CHECK: #[[MAP1:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
// CHECK: module {
@@ -115,7 +115,7 @@
return
}
-// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> ((s0 - s1) ceildiv s2)>
// CHECK: #[[MAP1:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
// CHECK: module {
@@ -166,7 +166,7 @@
return
}
-// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #[[MAP0:.*]] = affine_map<()[s0, s1, s2] -> ((s0 - s1) ceildiv s2)>
// CHECK: #[[MAP1:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
// CHECK: module {
@@ -241,7 +241,7 @@
}
// CHECK: #[[MAP0:.*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1)>
-// CHECK: #[[MAP1:.*]] = affine_map<()[s0, s1, s2] -> (s0 - s1 ceildiv s2)>
+// CHECK: #[[MAP1:.*]] = affine_map<()[s0, s1, s2] -> ((s0 - s1) ceildiv s2)>
// CHECK: #[[MAP2:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
// CHECK: #[[MAP3:.*]] = affine_map<(d0)[s0] -> (2, -d0 + s0)>
// CHECK: #[[MAP4:.*]] = affine_map<(d0)[s0] -> (3, -d0 + s0)>
Index: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
===================================================================
--- mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
+++ mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
@@ -653,8 +653,8 @@
// affine.apply here so that it composes nicely with the provided map.
AffineMap stepMap =
AffineMap::get(0, 3,
- (rewriter.getAffineSymbolExpr(0) -
- rewriter.getAffineSymbolExpr(1).ceilDiv(
+ ((rewriter.getAffineSymbolExpr(0) -
+ rewriter.getAffineSymbolExpr(1)).ceilDiv(
rewriter.getAffineSymbolExpr(2))));
Value launchBound = rewriter.create<AffineApplyOp>(
loc, annotation.boundMap.compose(stepMap),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75449.247630.patch
Type: text/x-patch
Size: 2806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200302/0f2aad11/attachment.bin>
More information about the llvm-commits
mailing list