[clang] [llvm] [clang][OpenMP] Add no-loop SPMD kernel promotion (PR #224041)

Nicole Aschenbrenner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 02:10:03 PDT 2026


================
@@ -66,6 +66,15 @@ static bool canEmitGPUFusedDistSchedule(const CodeGenModule &CGM,
          !S.getSingleClause<OMPOrderedClause>();
 }
 
+static bool canEmitGPUNoLoopKernel(CodeGenModule &CGM,
+                                   const OMPLoopDirective &S) {
+  const auto *D = dyn_cast<OMPTargetTeamsDistributeParallelForDirective>(&S);
+  return S.getLoopsNumber() == 1 &&
+         CGM.getOpenMPRuntime().canPromoteToNoLoop(S) &&
+         !S.getSingleClause<OMPScheduleClause>() &&
----------------
nicebert wrote:

Agreed, `schedule(static, 1)` doesn't need to be refused. #224650 further up the stack accepts it, along with `schedule(auto)`, and both are covered by its tests.

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


More information about the llvm-commits mailing list