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

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 08:50:08 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);
----------------
andykaylor wrote:

```suggestion
      mlir::Type intType = builder.getIntegerType(32);
```
Should the size here be based on the type of `numThreadValue`?

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


More information about the cfe-commits mailing list