[PATCH] D23813: AMDGPU/SI: Query AA, if available, in areMemAccessesTriviallyDisjoint()

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 05:13:45 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL279963: AMDGPU/SI: Query AA, if available, in areMemAccessesTriviallyDisjoint() (authored by tstellar).

Changed prior to commit:
  https://reviews.llvm.org/D23813?vs=69034&id=69557#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23813

Files:
  llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp

Index: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -1350,6 +1350,17 @@
   if (MIa.hasOrderedMemoryRef() || MIb.hasOrderedMemoryRef())
     return false;
 
+  if (AA && MIa.hasOneMemOperand() && MIb.hasOneMemOperand()) {
+    const MachineMemOperand *MMOa = *MIa.memoperands_begin();
+    const MachineMemOperand *MMOb = *MIb.memoperands_begin();
+    if (MMOa->getValue() && MMOb->getValue()) {
+      MemoryLocation LocA(MMOa->getValue(), MMOa->getSize(), MMOa->getAAInfo());
+      MemoryLocation LocB(MMOb->getValue(), MMOb->getSize(), MMOb->getAAInfo());
+      if (!AA->alias(LocA, LocB))
+        return true;
+    }
+  }
+
   // TODO: Should we check the address space from the MachineMemOperand? That
   // would allow us to distinguish objects we know don't alias based on the
   // underlying address space, even if it was lowered to a different one,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23813.69557.patch
Type: text/x-patch
Size: 1031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160829/05e0e892/attachment.bin>


More information about the llvm-commits mailing list