[clang] [CIR][OpenMP] Implementing part of the lowering for the 'default' clause for the 'parallel' directive (PR #235537)

Pedro da Rosa Pinheiro via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 29 15:21:04 PST 2026


================
@@ -190,3 +176,41 @@ bool OpenMPClauseEmitter::emitMap(
   }
   return found;
 }
+
+bool OpenMPClauseEmitter::emitNumThreads(
+    mlir::omp::NumThreadsClauseOps &result) const {
+  for (const OMPClause *clause : clauses) {
+    const auto *ntc = dyn_cast<OMPNumThreadsClause>(clause);
+    if (!ntc)
+      continue;
+
+    for (const Expr *expr : ntc->getNumThreads()) {
+      mlir::Value numThreadsValue = cgf.emitScalarExpr(expr);
+      auto intType = builder.getIntegerType(32);
----------------
pedropiin wrote:

Yes I think I agree. However I think I should fix this in a separate PR, given that this one is supposed to be `default` clause only. Those lines only show up in the diff because I've rearranged the function definitions to maintain alphabetical order. I think fixing this on this PR would mix things up. 
What do you think?

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


More information about the cfe-commits mailing list