[PATCH] [LoopAccesses 2/3] Allow querying of interesting dependences

hfinkel at anl.gov hfinkel at anl.gov
Mon Mar 9 13:13:00 PDT 2015


================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:798
@@ +797,3 @@
+              std::swap(A, B);
+
+            Dependence::DepType Type =
----------------
anemet wrote:
> hfinkel wrote:
> > I could be mis-remembering how this loop works, but it seems like we're doing twice as much work here as necessary. If there is a forward dependency between A and B, then there's a backward dependence between B and A? If the dependence of A and B is unknown, then the dependence of B and A is unknown. Could we take advantage of that here?
> > 
> I don't think that is how this this code works.
> 
> *AI and *OI are accesses using the same underlying pointers.  We do make sure we visit each pair only once (OI started from std::next(AI).
> 
> Now that said, you're right that if we have *multiple* instructions using either of the accesses *AI or *OI we invoke isDependent multiple times and will get the exact same result -- inDependent only uses the indices (*I1 and *I2) for debug output.  So all this can probably be simplified into isDepedent only taking *AI and *OI.
> 
> I can attempt to make this simplification in a follow-up.  Do you agree?
> I can attempt to make this simplification in a follow-up. Do you agree?

Agreed. Thanks!

http://reviews.llvm.org/D8114

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list