llvm.org GIT mirror llvm / 26bf6ea
[PM/AA] Actually wire the AAManager I built for the new pass manager into the new pass manager and fix the latent bugs there. This lets everything live together nicely, but it isn't really useful yet. I never finished wiring the AA layer up for the new pass manager, and so subsequent patches will change this to do that wiring and get AA stuff more fully integrated into the new pass manager. Turns out this is necessary even to get functionattrs ported over. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260836 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 4 years ago
5 changed file(s) with 23 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
982982 public:
983983 typedef AAResults Result;
984984
985 /// \brief Opaque, unique identifier for this analysis pass.
986 static void *ID() { return (void *)&PassID; }
987
988 /// \brief Provide access to a name for this pass.
989 static StringRef name() { return "AAManager"; }
990
985991 // This type hase value semantics. We have to spell these out because MSVC
986992 // won't synthesize them.
987993 AAManager() {}
10031009 FunctionResultGetters.push_back(&getFunctionAAResultImpl);
10041010 }
10051011
1006 Result run(Function &F, AnalysisManager &AM) {
1012 Result run(Function &F, AnalysisManager *AM) {
10071013 Result R;
10081014 for (auto &Getter : FunctionResultGetters)
1009 (*Getter)(F, AM, R);
1015 (*Getter)(F, *AM, R);
10101016 return R;
10111017 }
10121018
10131019 private:
1020 static char PassID;
1021
10141022 SmallVector &AM,
10151023 AAResults &AAResults),
10161024 4> FunctionResultGetters;
389389 // Provide a definition for the root virtual destructor.
390390 AAResults::Concept::~Concept() {}
391391
392 // Provide a definition for the static object used to identify passes.
393 char AAManager::PassID;
394
392395 namespace {
393396 /// A wrapper pass for external alias analyses. This just squirrels away the
394397 /// callback used to run any analyses and register their results.
1515 //===----------------------------------------------------------------------===//
1616
1717 #include "llvm/Passes/PassBuilder.h"
18 #include "llvm/Analysis/AliasAnalysis.h"
1819 #include "llvm/Analysis/AssumptionCache.h"
1920 #include "llvm/Analysis/CGSCCPassManager.h"
2021 #include "llvm/Analysis/LazyCallGraph.h"
5252 #ifndef FUNCTION_ANALYSIS
5353 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS)
5454 #endif
55 FUNCTION_ANALYSIS("aa", AAManager())
5556 FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis())
5657 FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis())
5758 FUNCTION_ANALYSIS("loops", LoopAnalysis())
297297 ; CHECK-DT: Running analysis: DominatorTreeAnalysis
298298 ; CHECK-DT: Finished pass manager
299299
300 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
301 ; RUN: -passes='require' \
302 ; RUN: | FileCheck %s --check-prefix=CHECK-AA
303 ; CHECK-AA: Starting pass manager
304 ; CHECK-AA: Running pass: RequireAnalysisPass
305 ; CHECK-AA: Running analysis: AAManager
306 ; CHECK-AA: Finished pass manager
307
300308 define void @foo() {
301309 ret void
302310 }