================
@@ -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:

I think we talked about this already at some point, but why doesn't 
firstprivate need to be handled here, too?

I still think that everything would be simpler if there would be a clean split 
between loop (structure) emitting and loop body emitting. This way, you always 
need to sync and keep up with EmitOMPWorksharingLoop. But maybe I'm missing 
something

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