fix warning caused by ef4ecc3cef

This commit is contained in:
Bardia Mahjour 2022-05-02 17:06:00 -04:00
parent 696092c703
commit 363b3a645a
2 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ private:
/// 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;

View File

@ -319,7 +319,7 @@ CacheCostTy IndexedReference::computeRefCost(const Loop &L,
// 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) {
@ -510,8 +510,8 @@ bool IndexedReference::isConsecutive(const Loop &L, unsigned CLS) const {
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;