summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-01-23 06:35:12 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-01-23 06:35:12 +0000
commita504f2b8e8fca0773a6e6d094f920f9a981341b9 (patch)
treed0aa2ad548b796fb57bb299a884c23816a0285ee /llvm/lib/Analysis/LazyValueInfo.cpp
parentb06bcde1ab0dd598c9d27c45e1d7553745c8077e (diff)
downloadbcm5719-llvm-a504f2b8e8fca0773a6e6d094f920f9a981341b9.tar.gz
bcm5719-llvm-a504f2b8e8fca0773a6e6d094f920f9a981341b9.zip
[PM] Teach LVI to correctly invalidate itself when its dependencies
become unavailable. The AssumptionCache is now immutable but it still needs to respond to DomTree invalidation if it ended up caching one. This lets us remove one of the explicit invalidates of LVI but the other one continues to avoid hitting a latent bug. llvm-svn: 292769
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index d442310476c..dc22b8173a8 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1503,6 +1503,18 @@ void LazyValueInfo::releaseMemory() {
}
}
+bool LazyValueInfo::invalidate(Function &F, const PreservedAnalyses &PA,
+ FunctionAnalysisManager::Invalidator &Inv) {
+ // We need to invalidate if we have either failed to preserve this analyses
+ // result directly or if any of its dependencies have been invalidated.
+ auto PAC = PA.getChecker<LazyValueAnalysis>();
+ if (!(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>()) ||
+ (DT && Inv.invalidate<DominatorTreeAnalysis>(F, PA)))
+ return true;
+
+ return false;
+}
+
void LazyValueInfoWrapperPass::releaseMemory() { Info.releaseMemory(); }
LazyValueInfo LazyValueAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
OpenPOWER on IntegriCloud