Improve the cache cost estimation for indexed references that are not consecutive. For example, given the indexed reference 'A[i][j][k]', and assuming the j-loop is in the innermost position in the loop nest containing the array reference, the cost would be equal to the RefCost cost times the iterations of the j-loop (rather than just the RefCost).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Analysis/LoopCacheAnalysis.h | ||
---|---|---|
107 | would be useful to mention that the index is zero-based. ie: "Retrive the zero-based \p Index of the subscript ..." | |
llvm/lib/Analysis/LoopCacheAnalysis.cpp | ||
310 | but in the code below we multiply the trip count for all indexes starting from the given loop up to the loop for the second last subscript. | |
320 | why getNumSubscripts() - 1 instead of just getNumSubscripts() ? |
llvm/lib/Analysis/LoopCacheAnalysis.cpp | ||
---|---|---|
106–119 | [sugggestion] if (auto *TripCount = dyn_cast<SCEVConstant>(BackedgeTakenCount)) return SE.getAddExpr(BackedgeTakenCount, SE.getOne(BackedgeTakenCount->getType()) LLVM_DEBUG(dbgs() << "Trip count of loop " << L.getName() << " could not be computed, using DefaultTripCount\n"); return SE.getConstant(ElemSize.getType(), DefaultTripCount); | |
107 | isa<SCEVCouldNotCompute> is redundant: the object cannot be SCEVCouldNotCompute and SCEVConstant at the same time | |
451 | What if:
|
would be useful to mention that the index is zero-based. ie: "Retrive the zero-based \p Index of the subscript ..."