/// succesfully located and a negative value otherwise. For example given the
/// indexed reference 'A[i][2j+1][3k+2]', the call
/// 'getSubscriptIndex(loop-k)' would return value 2.
- unsigned getSubscriptIndex(const Loop &L) const;
+ int getSubscriptIndex(const Loop &L) const;
/// Return the coefficient used in the rightmost dimension.
const SCEV *getLastCoefficient() const;
// iterations of the i-loop multiplied by iterations of the j-loop.
RefCost = TripCount;
- unsigned Index = getSubscriptIndex(L);
+ int Index = getSubscriptIndex(L);
assert(Index >= 0 && "Cound not locate a valid Index");
for (unsigned I = Index + 1; I < getNumSubscripts() - 1; ++I) {
return SE.isKnownPredicate(ICmpInst::ICMP_ULT, Stride, CacheLineSize);
}
-unsigned IndexedReference::getSubscriptIndex(const Loop &L) const {
- for (auto Idx : seq<unsigned>(0, getNumSubscripts())) {
+int IndexedReference::getSubscriptIndex(const Loop &L) const {
+ for (auto Idx : seq<int>(0, getNumSubscripts())) {
const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(getSubscript(Idx));
if (AR && AR->getLoop() == &L) {
return Idx;