================
@@ -706,27 +706,73 @@ static bool supportsSPMDExecutionMode(ASTContext &Ctx,
       "Unknown programming model for OpenMP directive on NVPTX target.");
 }
 
+static bool isNoLoopCompatibleSchedule(ASTContext &Ctx,
+                                       const OMPLoopDirective &LD) {
+  const auto *C = LD.getSingleClause<OMPScheduleClause>();
+  if (!C)
+    return true;
+
+  switch (C->getScheduleKind()) {
+  case OMPC_SCHEDULE_guided:
+  case OMPC_SCHEDULE_runtime:
+    return false;
+  case OMPC_SCHEDULE_auto:
+    return true;
+  default: {
+    const Expr *ChunkSize = C->getChunkSize();
+    Expr::EvalResult Result;
+    if (!ChunkSize || !ChunkSize->EvaluateAsInt(Result, Ctx))
+      return false;
+    return Result.Val.getInt().getLimitedValue() == 1;
+  }
+  }
+}
+
 static bool isNoLoopEligible(ASTContext &Ctx, const OMPExecutableDirective &D) 
{
----------------
nicebert wrote:

I've implemented this in #224041, so this PR picks it up once I rebase it onto 
the updated base.

https://github.com/llvm/llvm-project/pull/224650
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to