[clang] [llvm] [openmp] [OpenMP] Honour memory-order clauses on the flush directive (PR #241295)

Julian Brown via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 03:04:49 PST 2026


================
@@ -6979,8 +7004,13 @@ static void emitOMPAtomicReadExpr(CodeGenFunction &CGF, llvm::AtomicOrdering AO,
   case llvm::AtomicOrdering::Acquire:
   case llvm::AtomicOrdering::AcquireRelease:
   case llvm::AtomicOrdering::SequentiallyConsistent:
-    CGF.CGM.getOpenMPRuntime().emitFlush(CGF, {}, Loc,
-                                         llvm::AtomicOrdering::Acquire);
+    // NOTE: Previously, all flushes used __kmpc_flush, which uses
+    // sequentially-consistent ordering.  The unconditional use of
+    // SequentiallyConsistent here rather than passing AO through
+    // is to maintain that behaviour now that emitFlush honours its atomic
+    // ordering argument.
----------------
jtb20 wrote:

I've rebased on top of that patch now.

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


More information about the cfe-commits mailing list