Skip to content

Commit 5c5cab7

Browse files
committed
LAA: use make_early_inc_range to simplify code (NFC)
1 parent 95c0c78 commit 5c5cab7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,20 +3078,16 @@ const LoopAccessInfo &LoopAccessInfoManager::getInfo(Loop &L) {
30783078
return *It->second;
30793079
}
30803080
void LoopAccessInfoManager::clear() {
3081-
SmallVector<Loop *> ToRemove;
30823081
// Collect LoopAccessInfo entries that may keep references to IR outside the
30833082
// analyzed loop or SCEVs that may have been modified or invalidated. At the
30843083
// moment, that is loops requiring memory or SCEV runtime checks, as those cache
30853084
// SCEVs, e.g. for pointer expressions.
3086-
for (const auto &[L, LAI] : LoopAccessInfoMap) {
3085+
for (const auto &[L, LAI] : make_early_inc_range(LoopAccessInfoMap)) {
30873086
if (LAI->getRuntimePointerChecking()->getChecks().empty() &&
30883087
LAI->getPSE().getPredicate().isAlwaysTrue())
30893088
continue;
3090-
ToRemove.push_back(L);
3091-
}
3092-
3093-
for (Loop *L : ToRemove)
30943089
LoopAccessInfoMap.erase(L);
3090+
}
30953091
}
30963092

30973093
bool LoopAccessInfoManager::invalidate(

0 commit comments

Comments
 (0)