[llvm] [AMDGPU] Use wavefront scope for single-wave workgroup synchronization (PR #187673)

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 07:01:45 PDT 2026


================
@@ -117,7 +117,8 @@ class SIMemOpInfo final {
       bool IsCrossAddressSpaceOrdering = true,
       AtomicOrdering FailureOrdering = AtomicOrdering::SequentiallyConsistent,
       bool IsVolatile = false, bool IsNonTemporal = false,
-      bool IsLastUse = false, bool IsCooperative = false)
+      bool IsLastUse = false, bool IsCooperative = false,
+      const Function *ScopeDemotionFn = nullptr)
----------------
ritter-x2a wrote:

Would it make sense to pass the `Function` instead to the constructor of `SIMemOpAccess` (there seems to be one of those per `(Machine)Function` anyway), check there if we are in a single-wavefront workgroup once for the `Function`, and store the result to pass it as a boolean flag to the `SIMemOpInfo` constructor?
It seems odd to pass a `Function` to the `SIMemOpInfo` constructor just to determine one boolean flag, while so many other boolean flags are already passed to the constructor.

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


More information about the llvm-commits mailing list