Skip to content

Commit 0320512

Browse files
[Analysis] Avoid repeated hash lookups (NFC) (#131421)
1 parent 4230858 commit 0320512

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,8 +2287,9 @@ bool MemoryDepChecker::areDepsSafe(const DepCandidates &AccessSets,
22872287
(AIIsWrite ? AI : std::next(AI));
22882288
while (OI != AE) {
22892289
// Check every accessing instruction pair in program order.
2290-
for (std::vector<unsigned>::iterator I1 = Accesses[*AI].begin(),
2291-
I1E = Accesses[*AI].end(); I1 != I1E; ++I1)
2290+
auto &Acc = Accesses[*AI];
2291+
for (std::vector<unsigned>::iterator I1 = Acc.begin(), I1E = Acc.end();
2292+
I1 != I1E; ++I1)
22922293
// Scan all accesses of another equivalence class, but only the next
22932294
// accesses of the same equivalent class.
22942295
for (std::vector<unsigned>::iterator

0 commit comments

Comments
 (0)