Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions llvm/lib/Analysis/LoopAccessAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3078,20 +3078,16 @@ const LoopAccessInfo &LoopAccessInfoManager::getInfo(Loop &L) {
return *It->second;
}
void LoopAccessInfoManager::clear() {
SmallVector<Loop *> ToRemove;
// Collect LoopAccessInfo entries that may keep references to IR outside the
// analyzed loop or SCEVs that may have been modified or invalidated. At the
// moment, that is loops requiring memory or SCEV runtime checks, as those cache
// SCEVs, e.g. for pointer expressions.
for (const auto &[L, LAI] : LoopAccessInfoMap) {
for (const auto &[L, LAI] : make_early_inc_range(LoopAccessInfoMap)) {
if (LAI->getRuntimePointerChecking()->getChecks().empty() &&
LAI->getPSE().getPredicate().isAlwaysTrue())
continue;
ToRemove.push_back(L);
}

for (Loop *L : ToRemove)
LoopAccessInfoMap.erase(L);
}
}

bool LoopAccessInfoManager::invalidate(
Expand Down