[PATCH] D75468: [MLIR][GPU] Add error checking to loop.parallel to gpu transform.

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 02:09:38 PST 2020


ftynse accepted this revision.
ftynse added a comment.
This revision is now accepted and ready to land.

A couple of nits, looks good otherwise.



================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:575
                                          SmallVectorImpl<Operation *> &worklist,
+                                         llvm::DenseMap<int, Value> &bounds,
                                          PatternRewriter &rewriter) {
----------------
Nit: DenseMap is re-exported to the `mlir` namespace


================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:635
         if (!launchIndependent(lowerBound) &&
-            !isa<ConstantOp>(lowerBound.getDefiningOp()))
+            !dyn_cast_or_null<ConstantOp>(lowerBound.getDefiningOp()))
           return failure();
----------------
`isa_and_nonnull` here and below


================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:652
+            if (!upperBound) {
+              parallelOp.emitOpError() << "cannot derive loop-invariant upper "
+                                          "bound for number of iterations";
----------------
Nit: I think you can do `return paralellOp.emitOpError() ...`, it is convertible to LogicalResult


================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:675
+            parallelOp.emitOpError()
+                << "cannot redefine the bound for precessor "
+                << annotation.processor;
----------------
Typo: processor


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75468





More information about the llvm-commits mailing list