diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-04-30 22:15:47 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-04-30 22:15:47 +0000 |
| commit | ba48a2c5e856fd4221a0551d3b480a1b7fccac02 (patch) | |
| tree | dc57b4e930779b842f77877b354dc28007235469 /llvm/include | |
| parent | a6322941ffc15275e837435eee7aabba0ca15211 (diff) | |
| download | bcm5719-llvm-ba48a2c5e856fd4221a0551d3b480a1b7fccac02.tar.gz bcm5719-llvm-ba48a2c5e856fd4221a0551d3b480a1b7fccac02.zip | |
[AliasAnalysis/NewPassManager] Invalidate AAManager less often.
Summary:
This is a redo of D60914.
The objective is to not invalidate AAManager, which is stateless, unless
there is an explicit invalidate in one of the AAResults.
To achieve this, this patch adds an API to PAC, to check precisely this:
is this analysis not invalidated explicitly == is this analysis not abandoned == is this analysis stateless, so preserved without explicitly being marked as preserved by everyone
Reviewers: chandlerc
Subscribers: mehdi_amini, jlebar, george.burgess.iv, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61284
llvm-svn: 359622
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/AliasAnalysis.h | 5 | ||||
| -rw-r--r-- | llvm/include/llvm/IR/PassManager.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h index dc850e9152c..948341554f2 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -1096,6 +1096,11 @@ bool isIdentifiedFunctionLocal(const Value *V); /// This manager effectively wraps the AnalysisManager for registering alias /// analyses. When you register your alias analysis with this manager, it will /// ensure the analysis itself is registered with its AnalysisManager. +/// +/// The result of this analysis is only invalidated if one of the particular +/// aggregated AA results end up being invalidated. This removes the need to +/// explicitly preserve the results of `AAManager`. Note that analyses should no +/// longer be registered once the `AAManager` is run. class AAManager : public AnalysisInfoMixin<AAManager> { public: using Result = AAResults; diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 47bad5b2f19..37fe2a5b01a 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -286,6 +286,13 @@ public: PA.PreservedIDs.count(ID)); } + /// Return true if the checker's analysis was not abandoned, i.e. it was not + /// explicitly invalidated. Even if the analysis is not explicitly + /// preserved, if the analysis is known stateless, then it is preserved. + bool preservedWhenStateless() { + return !IsAbandoned; + } + /// Returns true if the checker's analysis was not abandoned and either /// - \p AnalysisSetT is explicitly preserved or /// - all analyses are preserved. |

