Skip to content

Commit cb6bdf5

Browse files
committed
add comments
1 parent 7fa263c commit cb6bdf5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/lib/Analysis/DependenceAnalysis.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,6 +3786,23 @@ bool DependenceInfo::tryDelinearizeParametricSize(
37863786
return false;
37873787
}
37883788

3789+
// TODO: Probably we need to prove that the "offset calculation" doesn't
3790+
// wrap. Here the offset calculation is:
3791+
//
3792+
// Offset =
3793+
// Subscripts[0] +
3794+
// Subscripts[1]*Sizes[0] +
3795+
// Subscripts[2]*Sizes[0]*Sizes[1] +
3796+
// ...
3797+
// Subscripts[N-1]*Sizes[0]*Sizes[1]*...*Sizes[N-2]
3798+
//
3799+
// where `N` is the number of dimensions. The subsequent dependence tests
3800+
// assume that different subscript values result in different offset values.
3801+
// If the above calculation wraps, this assumption is violated.
3802+
// Note that if every element of Subscripts is positive, the situation would
3803+
// be simple. However, the subscript for the outermost dimension
3804+
// (Subscripts[0]) can be negative.
3805+
37893806
return true;
37903807
}
37913808

0 commit comments

Comments
 (0)