diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2016-12-23 20:38:19 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2016-12-23 20:38:19 +0000 |
| commit | 060ad61fbe8c97dc58529a0f27b793ad5793b6b9 (patch) | |
| tree | 9fd1aadf1d59e0fd82cb120f7bf4c8e49dae2754 /llvm/lib | |
| parent | 3e8353724b8ef7e04c1ff1e0bad40a9d4233865b (diff) | |
| download | bcm5719-llvm-060ad61fbe8c97dc58529a0f27b793ad5793b6b9.tar.gz bcm5719-llvm-060ad61fbe8c97dc58529a0f27b793ad5793b6b9.zip | |
[PM] Add support for building a default AA pipeline to the PassBuilder.
Pretty boring and lame as-is but necessary. This is definitely a place
we'll end up with extension hooks longer term. =]
Differential Revision: https://reviews.llvm.org/D28076
llvm-svn: 290449
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 58b242efa34..b7609c994cf 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -544,6 +544,33 @@ ModulePassManager PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, return MPM; } +AAManager PassBuilder::buildDefaultAAPipeline() { + AAManager AA; + + // The order in which these are registered determines their priority when + // being queried. + + // First we register the basic alias analysis that provides the majority of + // per-function local AA logic. This is a stateless, on-demand local set of + // AA techniques. + AA.registerFunctionAnalysis<BasicAA>(); + + // Next we query fast, specialized alias analyses that wrap IR-embedded + // information about aliasing. + AA.registerFunctionAnalysis<ScopedNoAliasAA>(); + AA.registerFunctionAnalysis<TypeBasedAA>(); + + // Add support for querying global aliasing information when available. + // Because this is a module analysis this will use any cached analysis state + // available but isn't enough to cause it to be available. + // FIXME: Enable once the invalidation logic supports this. +#if 0 + AA.registerModuleAnalysis<GlobalsAA>(); +#endif + + return AA; +} + static Optional<int> parseRepeatPassName(StringRef Name) { if (!Name.consume_front("repeat<") || !Name.consume_back(">")) return None; @@ -1084,6 +1111,13 @@ bool PassBuilder::parsePassPipeline(ModulePassManager &MPM, } bool PassBuilder::parseAAPipeline(AAManager &AA, StringRef PipelineText) { + // If the pipeline just consists of the word 'default' just replace the AA + // manager with our default one. + if (PipelineText == "default") { + AA = buildDefaultAAPipeline(); + return true; + } + while (!PipelineText.empty()) { StringRef Name; std::tie(Name, PipelineText) = PipelineText.split(','); |

