diff options
author | Ramkumar Ramachandra <ramkumar.ramachandra@codasip.com> | 2025-02-03 16:06:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-03 16:06:21 +0000 |
commit | db43dd7f4fb60641911ffd6364c33e1f83c44b7f (patch) | |
tree | e2dcecf2e5059990661121380bf6420afe595c3c /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | fe8b323f598393d5a7cf468865c4f60d39cb0718 (diff) | |
download | llvm-db43dd7f4fb60641911ffd6364c33e1f83c44b7f.zip llvm-db43dd7f4fb60641911ffd6364c33e1f83c44b7f.tar.gz llvm-db43dd7f4fb60641911ffd6364c33e1f83c44b7f.tar.bz2 |
LAA: simplify LoopAccessInfoManager::clear (NFC) (#125488)
DenseMap::erase() doesn't invalidate the iterator.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index ac8a35f..3202ba8 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -3078,7 +3078,6 @@ 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 @@ -3087,11 +3086,8 @@ void LoopAccessInfoManager::clear() { if (LAI->getRuntimePointerChecking()->getChecks().empty() && LAI->getPSE().getPredicate().isAlwaysTrue()) continue; - ToRemove.push_back(L); - } - - for (Loop *L : ToRemove) LoopAccessInfoMap.erase(L); + } } bool LoopAccessInfoManager::invalidate( |