diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -58,12 +58,12 @@ 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 --- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp +++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp @@ -227,38 +227,39 @@ } // 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));