File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP(
109109 cl::desc (" Insert sanitizers on OptimizerEarlyEP." ), cl::init(false ));
110110}
111111
112+ static cl::opt<std::string> NewPMPasses (" newpm-passes" , cl::Optional,
113+ cl::desc (" Specify a custom pre-link pipeline. An empty string specifies the default pipeline." ),
114+ cl::init(" " ));
115+
112116namespace {
113117
114118// Default filename used for profile generation.
@@ -994,7 +998,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
994998 MPM.addPass (InstrProfiling (*Options, false ));
995999 });
9961000
997- if (CodeGenOpts.OptimizationLevel == 0 ) {
1001+ if (!NewPMPasses.empty ()) {
1002+ MPM = PB.buildO0DefaultPipeline (Level, IsLTO || IsThinLTO);
1003+ if (auto Err = PB.parsePassPipeline (MPM, NewPMPasses)) {
1004+ report_fatal_error (Twine (" unable to parse pass pipeline description '" ) +
1005+ NewPMPasses + " ': " + toString (std::move (Err)));
1006+ }
1007+ } else if (CodeGenOpts.OptimizationLevel == 0 ) {
9981008 MPM = PB.buildO0DefaultPipeline (Level, IsLTO || IsThinLTO);
9991009 } else if (IsThinLTO) {
10001010 MPM = PB.buildThinLTOPreLinkDefaultPipeline (Level);
You can’t perform that action at this time.
0 commit comments