[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:07 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);
+ numThreadsValue = builder.createBuiltinIntCast(numThreadsValue, intType);
----------------
andykaylor wrote:
I don't see this cast showing up in the test. Is this path covered?
https://github.com/llvm/llvm-project/pull/235537
More information about the cfe-commits
mailing list