[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 14:35:12 PDT 2024


================
@@ -607,15 +621,17 @@ class OpenMPIRBuilder {
   /// Generator for '#omp barrier'
   ///
   /// \param Loc The location where the barrier directive was encountered.
-  /// \param DK The kind of directive that caused the barrier.
+  /// \param Kind The kind of directive that caused the barrier.
   /// \param ForceSimpleCall Flag to force a simple (=non-cancellation) barrier.
   /// \param CheckCancelFlag Flag to indicate a cancel barrier return value
   ///                        should be checked and acted upon.
+  /// \param ThreadID Optional parameter to pass in any existing ThreadID value.
   ///
   /// \returns The insertion point after the barrier.
-  InsertPointTy createBarrier(const LocationDescription &Loc, omp::Directive DK,
-                              bool ForceSimpleCall = false,
-                              bool CheckCancelFlag = true);
+  InsertPointTy createBarrier(const LocationDescription &Loc,
+                              omp::Directive Kind, bool ForceSimpleCall = false,
+                              bool CheckCancelFlag = true,
+                              Value *ThreadID = nullptr);
----------------
jdoerfert wrote:

What has this to do with reductions? Either make it a pre-commit or just don't introduce this concept of "existing ThreadID values" again. Most (>90%) of the runtime functions that take a thread ID don't use it anyway. It's leftover from the old runtime.

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


More information about the cfe-commits mailing list