================
@@ -701,6 +701,18 @@ static bool supportsSPMDExecutionMode(ASTContext &Ctx,
"Unknown programming model for OpenMP directive on NVPTX target.");
}
+/// Check whether a target kernel can be promoted to a "no-loop" SPMD kernel,
+/// mirroring Flang's MLIR promotion path.
+static bool canPromoteToNoLoop(const LangOptions &LangOpts,
+ const OMPExecutableDirective &D) {
+ OpenMPDirectiveKind DKind = D.getDirectiveKind();
+ return (DKind == OMPD_target_teams_distribute_parallel_for ||
+ DKind == OMPD_target_teams_distribute_parallel_for_simd) &&
+ LangOpts.OpenMPTeamSubscription && LangOpts.OpenMPThreadSubscription
&&
+ !D.hasClausesOfKind<OMPNumTeamsClause>() &&
----------------
ro-i wrote:
excluding num_teams but allowing num_threads makes kinda sense because we have
much more freedom in choosing the number of teams, but that's not a hard
argument. Not sure if it makes sense to change it, tho
https://github.com/llvm/llvm-project/pull/205325
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits