summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DependenceAnalysis.cpp
diff options
context:
space:
mode:
authorPhilip Pfaffe <philip.pfaffe@gmail.com>2019-02-03 12:25:41 +0000
committerPhilip Pfaffe <philip.pfaffe@gmail.com>2019-02-03 12:25:41 +0000
commit9438585fe457d737322a9dde1cf285d76162a021 (patch)
treea7c0b2c1b0bd1dba541c6a5b985ee9dbe15da742 /llvm/lib/Analysis/DependenceAnalysis.cpp
parent5a570dd4374daaa1ea3110c507d852c68581c4c4 (diff)
downloadbcm5719-llvm-9438585fe457d737322a9dde1cf285d76162a021.tar.gz
bcm5719-llvm-9438585fe457d737322a9dde1cf285d76162a021.zip
[DA][NewPM] Handle transitive dependencies in the new-pm version of DA
Summary: The analysis result of DA caches pointers to AA, SCEV, and LI, but it never checks for their invalidation. Fix that. Reviewers: chandlerc, dmgreen, bogner Reviewed By: dmgreen Subscribers: hiraditya, bollu, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D56381 llvm-svn: 352986
Diffstat (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/DependenceAnalysis.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index 9b02df49ca1..8337b9b96ea 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -3368,6 +3368,19 @@ static void dumpSmallBitVector(SmallBitVector &BV) {
}
#endif
+bool DependenceInfo::invalidate(Function &F, const PreservedAnalyses &PA,
+ FunctionAnalysisManager::Invalidator &Inv) {
+ // Check if the analysis itself has been invalidated.
+ auto PAC = PA.getChecker<DependenceAnalysis>();
+ if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<Function>>())
+ return true;
+
+ // Check transitive dependencies.
+ return Inv.invalidate<AAManager>(F, PA) ||
+ Inv.invalidate<ScalarEvolutionAnalysis>(F, PA) ||
+ Inv.invalidate<LoopAnalysis>(F, PA);
+}
+
// depends -
// Returns NULL if there is no dependence.
// Otherwise, return a Dependence with as many details as possible.
OpenPOWER on IntegriCloud