Skip to content

Commit 41a1523

Browse files
committed
adjust comment
1 parent 1966fe0 commit 41a1523

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/lib/Analysis/LoopCacheAnalysis.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,13 @@ bool IndexedReference::tryDelinearizeFixedSize(
363363
return false;
364364
}
365365

366-
// Drop the last element of Sizes which is the same as ElementSize.
367-
assert(!Sizes.empty() && Sizes.back() == ElementSize &&
368-
"Expecting the last one to be the element size");
366+
// We expect Sizes to have one more element than Subscripts, with the last one
367+
// is ElementSize. The last element of Sizes is for ensuring consistency with
368+
// the load/store instruction being analyzed. It is not needed for further
369+
// analysis.
370+
// TODO: Maybe this property should be enforced in delinearizeFixedSizeArray.
371+
assert(!Sizes.empty() && Subscripts.size() + 1 == Sizes.size() &&
372+
Sizes.back() == ElementSize && "Unexpected delinearization result");
369373
Sizes.pop_back();
370374
return true;
371375
}

0 commit comments

Comments
 (0)