fix warning caused by ef4ecc3ceffcf3ef129640c813f823c974f9ba22
authorBardia Mahjour <bmahjour@ca.ibm.com>
Mon, 2 May 2022 21:06:00 +0000 (17:06 -0400)
committerBardia Mahjour <bmahjour@ca.ibm.com>
Mon, 2 May 2022 21:06:27 +0000 (17:06 -0400)
llvm/include/llvm/Analysis/LoopCacheAnalysis.h
llvm/lib/Analysis/LoopCacheAnalysis.cpp

index 34d5ce5..ebfd5bb 100644 (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;
index 8ebf77b..eacd262 100644 (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;