diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-11-04 11:23:46 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-11-04 15:10:34 -0700 |
commit | 13317286f8298eb3bafa9ddebd1c03bef4918948 (patch) | |
tree | 937cba3cbf6d22b47f3d5abb16f7dc612163d2ce /llvm/lib/LTO/LTOBackend.cpp | |
parent | a2639dcbe613bb2e219a50171f322d7ac1dc8de1 (diff) | |
download | llvm-13317286f8298eb3bafa9ddebd1c03bef4918948.zip llvm-13317286f8298eb3bafa9ddebd1c03bef4918948.tar.gz llvm-13317286f8298eb3bafa9ddebd1c03bef4918948.tar.bz2 |
[NewPM] Use the default AA pipeline by default
We almost always want to use the default AA pipeline. It's very easy for
users of PassBuilder to forget to customize the AAManager to use the
default AA pipeline (for example, the NewPM C API forgets to do this).
If somebody wants a custom AA pipeline, similar to what is being done
now with the default AA pipeline registration, they can
FAM.registerPass([&] { return std::move(MyAA); });
before calling
PB.registerFunctionAnalyses(FAM);
For example, LTOBackend.cpp and NewPMDriver.cpp do this.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D113210
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index d0e3b45d..be06556 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -251,18 +251,16 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM, TLII->disableAllFunctions(); FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); }); - AAManager AA; // Parse a custom AA pipeline if asked to. if (!Conf.AAPipeline.empty()) { + AAManager AA; if (auto Err = PB.parseAAPipeline(AA, Conf.AAPipeline)) { report_fatal_error(Twine("unable to parse AA pipeline description '") + Conf.AAPipeline + "': " + toString(std::move(Err))); } - } else { - AA = PB.buildDefaultAAPipeline(); + // Register the AA manager first so that our version is the one used. + FAM.registerPass([&] { return std::move(AA); }); } - // Register the AA manager first so that our version is the one used. - FAM.registerPass([&] { return std::move(AA); }); // Register all the basic analyses with the managers. PB.registerModuleAnalyses(MAM); |