================
@@ -3934,6 +3961,55 @@ emitInnerParallelForWhenCombined(CodeGenFunction &CGF,
         HasCancel = D->hasCancel();
     }
     CodeGenFunction::OMPCancelStackRAII CancelRegion(CGF, EKind, HasCancel);
+
+    CodeGenModule &CGM = CGF.CGM;
+    if (CGM.getOpenMPRuntime().canPromoteToNoLoop()) {
+      // Prepare the loop variables and their privatization.
+      emitLoopIterationspaceVars(CGF, S);
+      OMPLoopScope PreInitScope(CGF, S);
+
+      CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
+      CGF.EmitOMPPrivateClause(S, PrivateScope);
----------------
ro-i wrote:

> It does not. firstprivate is already handled at the distribute level for SPMD 
> kernels.

hm, but why does the existing EmitOMPWorksharingLoop handle it?

https://github.com/llvm/llvm-project/blob/d6944e952a0f706fb1c19c9d3d7342667b58c7f3/clang/lib/CodeGen/CGStmtOpenMP.cpp#L4141-L4148

Regarding the split: I was just thinking about sth like this: 
https://github.com/llvm/llvm-project/pull/220540 (I already created that for 
demonstration in an earlier discussion). Without the no-loop work, this split 
is a bit hard to test, but in the context of your work, it might be useful and 
would probably simplify things for you?

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

Reply via email to