[llvm-branch-commits] [mlir] [OpenMP][MLIR] Add num_threads clause with dims modifier support (PR #171767)

Michael Klemm via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 18 06:46:12 PST 2025


================
@@ -2601,14 +2604,39 @@ static LogicalResult verifyPrivateVarList(OpType &op) {
   return success();
 }
 
+// Helper: Verify num_threads clause
+LogicalResult
+verifyNumThreadsClause(Operation *op,
+                       std::optional<IntegerAttr> numThreadsNumDims,
+                       OperandRange numThreadsDimsValues, Value numThreads) {
+  bool hasDimsModifier =
+      numThreadsNumDims.has_value() && numThreadsNumDims.value();
+  if (hasDimsModifier && numThreads) {
+    return op->emitError("num_threads with dims modifier cannot be used "
+                         "together with number of threads");
----------------
mjklemm wrote:

This error message does not make much sense to me.

https://github.com/llvm/llvm-project/pull/171767


More information about the llvm-branch-commits mailing list