[PATCH] D58295: AMDGPU: Fix memory dependence analysis by considering the offset.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 15 11:19:54 PST 2019


arsenm requested changes to this revision.
arsenm added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2218-2232
   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());
+
+      int64_t MinOffset = std::min(MMOa->getOffset(), MMOb->getOffset());
+      int64_t Overlapa = MMOa->getSize() + MMOa->getOffset() - MinOffset;
----------------
Why can't you use MI.mayAlias and delete this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58295/new/

https://reviews.llvm.org/D58295





More information about the llvm-commits mailing list