[Mlir-commits] [mlir] 63ca276 - [mlir][openmp][NFC]Remove unnecessary brackets and rephrase ParallelOp description in mlir definition

Irina Dobrescu llvmlistbot at llvm.org
Fri Oct 9 07:22:10 PDT 2020


Author: Irina Dobrescu
Date: 2020-10-09T15:21:44+01:00
New Revision: 63ca276dc64f3869aec9a05250bd64b8f423ab44

URL: https://github.com/llvm/llvm-project/commit/63ca276dc64f3869aec9a05250bd64b8f423ab44
DIFF: https://github.com/llvm/llvm-project/commit/63ca276dc64f3869aec9a05250bd64b8f423ab44.diff

LOG: [mlir][openmp][NFC]Remove unnecessary brackets and rephrase ParallelOp description in mlir definition

Differential Revision: https://reviews.llvm.org/D88740

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
index 4fa30d056183..02bae9d43322 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
@@ -58,12 +58,12 @@ def ParallelOp : OpenMP_Op<"parallel", [AttrSizedOperandSegments]> {
     should be used to execute the parallel region.
 
     The optional $default_val attribute specifies the default data sharing attribute
-    of variables used in the parallel region that are not passed explicitly as parameters
+    of values used in the parallel region that are not passed explicitly as parameters
     to the operation.
 
     The $private_vars, $firstprivate_vars, $shared_vars and $copyin_vars parameters
-    are a variadic list of variables that specify the data sharing attribute of
-    those variables.
+    are a variadic list of values that specify the data sharing attribute of
+    those values.
 
     The optional $proc_bind_val attribute controls the thread affinity for the execution
     of the parallel region.

diff  --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index 3298c37a0fa9..84db8e798b2f 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -227,38 +227,39 @@ static ParseResult parseParallelOp(OpAsmParser &parser,
   }
 
   // Add if parameter
-  if (segments[ifClausePos]) {
-    parser.resolveOperand(ifCond.first, ifCond.second, result.operands);
-  }
+  if (segments[ifClausePos] &&
+      parser.resolveOperand(ifCond.first, ifCond.second, result.operands))
+    return failure();
 
   // Add num_threads parameter
-  if (segments[numThreadsClausePos]) {
-    parser.resolveOperand(numThreads.first, numThreads.second, result.operands);
-  }
+  if (segments[numThreadsClausePos] &&
+      parser.resolveOperand(numThreads.first, numThreads.second,
+                            result.operands))
+    return failure();
 
   // Add private parameters
-  if (segments[privateClausePos]) {
-    parser.resolveOperands(privates, privateTypes, privates[0].location,
-                           result.operands);
-  }
+  if (segments[privateClausePos] &&
+      parser.resolveOperands(privates, privateTypes, privates[0].location,
+                             result.operands))
+    return failure();
 
   // Add firstprivate parameters
-  if (segments[firstprivateClausePos]) {
-    parser.resolveOperands(firstprivates, firstprivateTypes,
-                           firstprivates[0].location, result.operands);
-  }
+  if (segments[firstprivateClausePos] &&
+      parser.resolveOperands(firstprivates, firstprivateTypes,
+                             firstprivates[0].location, result.operands))
+    return failure();
 
   // Add shared parameters
-  if (segments[sharedClausePos]) {
-    parser.resolveOperands(shareds, sharedTypes, shareds[0].location,
-                           result.operands);
-  }
+  if (segments[sharedClausePos] &&
+      parser.resolveOperands(shareds, sharedTypes, shareds[0].location,
+                             result.operands))
+    return failure();
 
   // Add copyin parameters
-  if (segments[copyinClausePos]) {
-    parser.resolveOperands(copyins, copyinTypes, copyins[0].location,
-                           result.operands);
-  }
+  if (segments[copyinClausePos] &&
+      parser.resolveOperands(copyins, copyinTypes, copyins[0].location,
+                             result.operands))
+    return failure();
 
   result.addAttribute("operand_segment_sizes",
                       parser.getBuilder().getI32VectorAttr(segments));


        


More information about the Mlir-commits mailing list