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

CHANDRA GHALE via cfe-commits cfe-commits at lists.llvm.org
Wed May 7 05:10:20 PDT 2025


================
@@ -4899,6 +4899,238 @@ void CGOpenMPRuntime::emitSingleReductionCombiner(CodeGenFunction &CGF,
   }
 }
 
+void CGOpenMPRuntime::emitPrivateReduction(
----------------
chandraghale wrote:

- Updated the code with comments and clarified the logic
- Updated OpenMPSupport.rst and the release notes.
- Unified the logic as much as possible.
- In regular reduction codegen, threads update a shared variable directly. With private reduction, each thread first works with its own private copy, and then all these partial results are combined into a shared variable. The final result is copied back to each thread’s original variable

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


More information about the cfe-commits mailing list