-
Notifications
You must be signed in to change notification settings - Fork 15.3k
LAA: simplify LoopAccessInfoManager::clear (NFC) #125488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-llvm-analysis Author: Ramkumar Ramachandra (artagnon) ChangesFull diff: https://github.com/llvm/llvm-project/pull/125488.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index ac8a35fbc54fb1d..7e4358dc62b1e08 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -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(
|
fhahn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,thanks
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/15143 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/53/builds/11759 Here is the relevant piece of the build log for the reference |
DenseMap::erase() doesn't invalidate the iterator.
DenseMap::erase() doesn't invalidate the iterator.