================
@@ -207,6 +208,17 @@ class SIMemOpInfo final {
// AGENT scope as a conservatively correct alternative.
if (this->Scope == SIAtomicScope::CLUSTER && !ST.hasClusters())
this->Scope = SIAtomicScope::AGENT;
+
+ // When max flat work-group size is at most the wavefront size, the
+ // work-group fits in a single wave, so LLVM workgroup scope matches
+ // wavefront scope. Demote workgroup → wavefront here for fences and for
+ // atomics with ordering stronger than monotonic.
+ if (CanDemoteWorkgroupToWavefront &&
+ this->Scope == SIAtomicScope::WORKGROUP &&
+ (llvm::isStrongerThan(this->Ordering, AtomicOrdering::Monotonic) ||
----------------
zGoldthorpe wrote:
Sorry, I just re-applied 187673 verbatim and then added the DMA check on top.
It seems this was also brought up in the original PR in [this
comment](https://github.com/llvm/llvm-project/pull/187673#discussion_r3022125266),
without address.
I agree, though; this demotion logic should apply uniformly.
https://github.com/llvm/llvm-project/pull/224065
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits