[clang] [openmp] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon May 19 12:46:59 PDT 2025


================
@@ -5200,6 +5428,26 @@ void CGOpenMPRuntime::emitReduction(CodeGenFunction &CGF, SourceLocation Loc,
 
   CGF.EmitBranch(DefaultBB);
   CGF.EmitBlock(DefaultBB, /*IsFinished=*/true);
+  if (Options.IsPrivateVarReduction) {
+    if (LHSExprs.empty() || Privates.empty() || ReductionOps.empty())
+      return;
+    if (LHSExprs.size() != Privates.size() ||
+        LHSExprs.size() != ReductionOps.size())
+      return;
----------------
alexey-bataev wrote:

This code musy be removed and transformed into asserts

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


More information about the cfe-commits mailing list