diff options
author | Alina Sbirlea <asbirlea@google.com> | 2019-04-23 17:21:18 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2019-04-23 17:21:18 +0000 |
commit | a809e8e5e759d333e3183b4f1d270cfc4ad9d2dd (patch) | |
tree | 5f9a3aa681c99dff87b95123c8e06e662637e2f9 /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | e50e6d256375b47efb30a6f9f1fe795f7d95a8a3 (diff) | |
download | bcm5719-llvm-a809e8e5e759d333e3183b4f1d270cfc4ad9d2dd.tar.gz bcm5719-llvm-a809e8e5e759d333e3183b4f1d270cfc4ad9d2dd.zip |
[AliasAnalysis] AAResults preserves AAManager.
Summary:
AAResults should not invalidate AAManager.
Update tests.
Reviewers: chandlerc
Subscribers: mehdi_amini, jlebar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60914
llvm-svn: 359014
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index 06a33f659c1..4bb3b80511a 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -79,12 +79,10 @@ AAResults::~AAResults() { bool AAResults::invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv) { - // Check if the AA manager itself has been invalidated. - auto PAC = PA.getChecker<AAManager>(); - if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<Function>>()) - return true; // The manager needs to be blown away, clear everything. - - // Check all of the dependencies registered. + // AAResults preserves the AAManager by default, due to the stateless nature + // of AliasAnalysis. There is no need to check whether it has been preserved + // explicitly. However, we still need to check if any of the dependencies end + // up being invalidated, and invalidate ourselves in that case. for (AnalysisKey *ID : AADeps) if (Inv.invalidate(ID, F, PA)) return true; |