[llvm] [Attributor] Add support for atomic operations in `AAAddressSpace` (PR #106927)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 07:50:15 PDT 2024


================
@@ -12583,10 +12583,14 @@ struct AAAddressSpaceImpl : public AAAddressSpace {
         return true;
       if (isa<LoadInst>(Inst))
         MakeChange(Inst, const_cast<Use &>(U));
-      if (isa<StoreInst>(Inst)) {
+      else if (isa<StoreInst>(Inst)) {
         // We only make changes if the use is the pointer operand.
         if (U.getOperandNo() == 1)
           MakeChange(Inst, const_cast<Use &>(U));
+      } else if (isa<AtomicRMWInst>(Inst) || isa<AtomicCmpXchgInst>(Inst)) {
+        // We only make changes if the use is the pointer operand.
+        if (U.getOperandNo() == 0)
----------------
shiltian wrote:

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

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


More information about the llvm-commits mailing list