Skip to content

Commit 9e9ce50

Browse files
committed
[LoopInterchange] Use const auto & in a couple of places
1 parent bb5a7e1 commit 9e9ce50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/LoopInterchange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ struct LoopInterchange {
552552
// For the old pass manager CacheCost would be null.
553553
DenseMap<const Loop *, unsigned> CostMap;
554554
if (CC)
555-
for (auto [Idx, Cost] : enumerate(CC->getLoopCosts()))
555+
for (const auto &[Idx, Cost] : enumerate(CC->getLoopCosts()))
556556
CostMap[Cost.first] = Idx;
557557

558558
// We try to achieve the globally optimal memory access for the loopnest,
@@ -1217,7 +1217,7 @@ LoopInterchangeProfitability::isProfitablePerInstrOrderCost() {
12171217

12181218
/// Return true if we can vectorize the loop specified by \p LoopId.
12191219
static bool canVectorize(const CharMatrix &DepMatrix, unsigned LoopId) {
1220-
for (auto Dep : DepMatrix) {
1220+
for (const auto &Dep : DepMatrix) {
12211221
char Dir = Dep[LoopId];
12221222
if (Dir != 'I' && Dir != '=')
12231223
return false;

0 commit comments

Comments
 (0)