[llvm-branch-commits] [mlir] [OpenMP][MLIR] Add thread_limit mlir->llvm lowering (PR #179608)
Sergio Afonso via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Apr 14 06:08:46 PDT 2026
================
@@ -6341,9 +6370,25 @@ initTargetRuntimeAttrs(llvm::IRBuilderBase &builder,
attrs.MaxTeams.front() = builder.CreateSExtOrTrunc(
moduleTranslation.lookupValue(numTeamsUpper), builder.getInt32Ty());
- if (teamsThreadLimit)
- attrs.TeamsThreadLimit.front() = builder.CreateSExtOrTrunc(
- moduleTranslation.lookupValue(teamsThreadLimit), builder.getInt32Ty());
+ if (!teamsThreadLimitVars.empty()) {
+ attrs.TeamsThreadLimit.clear();
+ llvm::transform(teamsThreadLimitVars,
+ std::back_inserter(attrs.TeamsThreadLimit),
+ [&](Value limitVar) -> llvm::Value * {
+ return limitVar
+ ? builder.CreateSExtOrTrunc(
+ moduleTranslation.lookupValue(limitVar),
+ builder.getInt32Ty())
+ : nullptr;
+ });
+ }
+
+ // Ensure TargetThreadLimit and TeamsThreadLimit have matching sizes
+ // for zip_equal in OMPIRBuilder.
----------------
skatrak wrote:
Nit: I wouldn't put `zip_equal` as the reason for it (there's `zip` and `zip_longest`, if we wanted to use that). We can say we just make sure they have matching sizes.
https://github.com/llvm/llvm-project/pull/179608
More information about the llvm-branch-commits
mailing list