@@ -853,9 +853,19 @@ bool sortPtrAccesses(ArrayRef<Value *> VL, Type *ElemTy, const DataLayout &DL,
853
853
bool isConsecutiveAccess (Value *A, Value *B, const DataLayout &DL,
854
854
ScalarEvolution &SE, bool CheckType = true );
855
855
856
- // / For a given Loop \p Lp and pointer \p PtrExpr return a pair of SCEV values
857
- // / representing the maximum range of addresses accessed in the loop, i.e.
858
- // / [min,max).
856
+ // / Calculate Start and End points of memory access.
857
+ // / Let's assume A is the first access and B is a memory access on N-th loop
858
+ // / iteration. Then B is calculated as:
859
+ // / B = A + Step*N .
860
+ // / Step value may be positive or negative.
861
+ // / N is a calculated back-edge taken count:
862
+ // / N = (TripCount > 0) ? RoundDown(TripCount -1 , VF) : 0
863
+ // / Start and End points are calculated in the following way:
864
+ // / Start = UMIN(A, B) ; End = UMAX(A, B) + SizeOfElt,
865
+ // / where SizeOfElt is the size of single memory access in bytes.
866
+ // /
867
+ // / There is no conflict when the intervals are disjoint:
868
+ // / NoConflict = (P2.Start >= P1.End) || (P1.Start >= P2.End)
859
869
std::pair<const SCEV *, const SCEV *> getStartAndEndForAccess (
860
870
const Loop *Lp, const SCEV *PtrExpr, Type *AccessTy, const SCEV *MaxBECount,
861
871
ScalarEvolution *SE,
0 commit comments