summaryrefslogtreecommitdiff
path: root/lib/LTO
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-08-02 03:03:19 +0000
committerDehao Chen <dehao@google.com>2017-08-02 03:03:19 +0000
commitb929c3e6e4f20170cb8427ca63236a1563ac4a4b (patch)
tree128b119f7bcd910d378abc6c8e7ec4338b8ba933 /lib/LTO
parentf7a9c73f74592809d1b298d4a608da25c88df17b (diff)
Fix the bug that parseAAPipeline is not invoked in runNewPMPasses in release compiler.
Summary: The logic is guarded by "assert". Reviewers: davidxl, davide, chandlerc Reviewed By: davide, chandlerc Subscribers: sanjoy, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D36195 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO')
-rw-r--r--lib/LTO/LTOBackend.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp
index 6d1e37fa7e1..5c113212041 100644
--- a/lib/LTO/LTOBackend.cpp
+++ b/lib/LTO/LTOBackend.cpp
@@ -141,12 +141,13 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM,
AAManager AA;
// Parse a custom AA pipeline if asked to.
- assert(PB.parseAAPipeline(AA, "default"));
+ if (!PB.parseAAPipeline(AA, "default"))
+ report_fatal_error("Error parsing default AA pipeline");
- LoopAnalysisManager LAM;
- FunctionAnalysisManager FAM;
- CGSCCAnalysisManager CGAM;
- ModuleAnalysisManager MAM;
+ LoopAnalysisManager LAM(Conf.DebugPassManager);
+ FunctionAnalysisManager FAM(Conf.DebugPassManager);
+ CGSCCAnalysisManager CGAM(Conf.DebugPassManager);
+ ModuleAnalysisManager MAM(Conf.DebugPassManager);
// Register the AA manager first so that our version is the one used.
FAM.registerPass([&] { return std::move(AA); });
@@ -158,7 +159,7 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM,
PB.registerLoopAnalyses(LAM);
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
- ModulePassManager MPM;
+ ModulePassManager MPM(Conf.DebugPassManager);
// FIXME (davide): verify the input.
PassBuilder::OptimizationLevel OL;
@@ -181,9 +182,9 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM,
}
if (IsThinLTO)
- MPM = PB.buildThinLTODefaultPipeline(OL, false /* DebugLogging */);
+ MPM = PB.buildThinLTODefaultPipeline(OL, Conf.DebugPassManager);
else
- MPM = PB.buildLTODefaultPipeline(OL, false /* DebugLogging */);
+ MPM = PB.buildLTODefaultPipeline(OL, Conf.DebugPassManager);
MPM.run(Mod, MAM);
// FIXME (davide): verify the output.