[PATCH] D24189: [LAA] Extend isConsecutiveAccess to determine if two accesses are consecutive, reverse consecutive, or non-consecutive.

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 10:13:11 PDT 2016


mkuper added a comment.

I'm not sure this is a clear compile-time win. We'll get less calls to isConsecutiveAcess, but most of the clients - except for the Load case in buildTree_rec() - care only about one direction. We'll see what regression testing shows, I guess. My guess is "noise". :-)


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:718
@@ -717,5 +717,3 @@
 
-/// \brief Returns true if the memory operations \p A and \p B are consecutive.
-/// This is a simple API that does not depend on the analysis pass. 
-bool isConsecutiveAccess(Value *A, Value *B, const DataLayout &DL,
-                         ScalarEvolution &SE, bool CheckType = true);
+/// \brief Returns 1 if the memory operations \p A and \p B are consecutive and
+/// B follows A. Returns -1 if the memory operations \p A and \p B are
----------------
Any compelling reason not to make this an enum?

================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:1083
@@ +1082,3 @@
+  OffsetDeltaSCEV = SE.getMinusSCEV(OffsetSCEVB, OffsetSCEVA);
+  BaseDelta = SE.getMinusSCEV(SizeSCEV, OffsetDeltaSCEV);
+  X = SE.getAddExpr(PtrSCEVB, BaseDelta);
----------------
Aren't these the same values BaseDelta and OffsetDeltaSCEV already have?


https://reviews.llvm.org/D24189





More information about the llvm-commits mailing list