================
@@ -393,15 +391,29 @@ bool isReallyAClobber(const Value *Ptr, MemoryDef *Def, 
AAResults *AA) {
     }
   }
 
-  // Ignore atomics not aliasing with the original load, any atomic is a
-  // universal MemoryDef from MSSA's point of view too, just like a fence.
-  const auto checkNoAlias = [AA, Ptr](auto I) -> bool {
-    return I && AA->isNoAlias(I->getPointerOperand(), Ptr);
+  // Ignore non-acquire atomics not aliasing with the original load, any atomic
+  // is a universal MemoryDef from MSSA's point of view too, just like a fence.
+  // Acquire (or stronger) fences/atomics act as clobbers because they can 
bring
+  // in effects from other threads.
+  const auto MayAlias = [AA, Ptr](auto I) -> bool {
+    return !AA->isNoAlias(I->getPointerOperand(), Ptr);
   };
 
-  if (checkNoAlias(dyn_cast<AtomicCmpXchgInst>(DefInst)) ||
-      checkNoAlias(dyn_cast<AtomicRMWInst>(DefInst)))
-    return false;
+  if (const auto *F = dyn_cast<FenceInst>(DefInst))
+    return isAcquireOrStronger(F->getOrdering());
----------------
krzysz00 wrote:

I think this is the spot where we check for MMRAs on the fence to make sure we 
aren't pessimizing based on LDS-only fences

https://github.com/llvm/llvm-project/pull/219991
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to