llvm.org GIT mirror llvm / b929c3e
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 Dehao Chen 3 years ago
4 changed file(s) with 24 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
7777
7878 /// Whether to emit optimization remarks with hotness informations.
7979 bool RemarksWithHotness = false;
80
81 /// Whether to emit the pass manager debuggging informations.
82 bool DebugPassManager = false;
8083
8184 bool ShouldDiscardValueNames = true;
8285 DiagnosticHandlerFunction DiagHandler;
140140 AAManager AA;
141141
142142 // Parse a custom AA pipeline if asked to.
143 assert(PB.parseAAPipeline(AA, "default"));
144
145 LoopAnalysisManager LAM;
146 FunctionAnalysisManager FAM;
147 CGSCCAnalysisManager CGAM;
148 ModuleAnalysisManager MAM;
143 if (!PB.parseAAPipeline(AA, "default"))
144 report_fatal_error("Error parsing default AA pipeline");
145
146 LoopAnalysisManager LAM(Conf.DebugPassManager);
147 FunctionAnalysisManager FAM(Conf.DebugPassManager);
148 CGSCCAnalysisManager CGAM(Conf.DebugPassManager);
149 ModuleAnalysisManager MAM(Conf.DebugPassManager);
149150
150151 // Register the AA manager first so that our version is the one used.
151152 FAM.registerPass([&] { return std::move(AA); });
157158 PB.registerLoopAnalyses(LAM);
158159 PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
159160
160 ModulePassManager MPM;
161 ModulePassManager MPM(Conf.DebugPassManager);
161162 // FIXME (davide): verify the input.
162163
163164 PassBuilder::OptimizationLevel OL;
180181 }
181182
182183 if (IsThinLTO)
183 MPM = PB.buildThinLTODefaultPipeline(OL, false /* DebugLogging */);
184 MPM = PB.buildThinLTODefaultPipeline(OL, Conf.DebugPassManager);
184185 else
185 MPM = PB.buildLTODefaultPipeline(OL, false /* DebugLogging */);
186 MPM = PB.buildLTODefaultPipeline(OL, Conf.DebugPassManager);
186187 MPM.run(Mod, MAM);
187188
188189 // FIXME (davide): verify the output.
0 ; RUN: llvm-as < %s > %t1.bc
1
2 ; Try the default pipeline and check is BasicAA is invoked.
3 ; RUN: llvm-lto2 run %t1.bc -o %t.o -r %t1.bc,patatino,px -debug-pass-manager \
4 ; RUN: -use-new-pm 2>&1 | FileCheck %s --check-prefix=DEFAULT
5 ; DEFAULT: Running analysis: BasicAA on patatino
16
27 ; Try a custom pipeline
38 ; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
107107 UseNewPM("use-new-pm",
108108 cl::desc("Run LTO passes using the new pass manager"),
109109 cl::init(false), cl::Hidden);
110
111 static cl::opt
112 DebugPassManager("debug-pass-manager", cl::init(false), cl::Hidden,
113 cl::desc("Print pass management debugging information"));
110114
111115 static void check(Error E, std::string Msg) {
112116 if (!E)
194198 Conf.RelocModel = *RM;
195199 Conf.CodeModel = CMModel;
196200
201 Conf.DebugPassManager = DebugPassManager;
202
197203 if (SaveTemps)
198204 check(Conf.addSaveTemps(OutputFilename + "."),
199205 "Config::addSaveTemps failed");