@@ -118,6 +118,7 @@ class PipelineTuningOptions {
118
118
// / of the built-in passes, and those may reference these members during
119
119
// / construction.
120
120
class PassBuilder {
121
+ bool DebugLogging;
121
122
TargetMachine *TM;
122
123
PipelineTuningOptions PTO;
123
124
Optional<PGOOptions> PGOOpt;
@@ -259,11 +260,10 @@ class PassBuilder {
259
260
unsigned getSizeLevel () const { return SizeLevel; }
260
261
};
261
262
262
- explicit PassBuilder (TargetMachine *TM = nullptr ,
263
+ explicit PassBuilder (bool DebugLogging = false , TargetMachine *TM = nullptr ,
263
264
PipelineTuningOptions PTO = PipelineTuningOptions(),
264
265
Optional<PGOOptions> PGOOpt = None,
265
- PassInstrumentationCallbacks *PIC = nullptr)
266
- : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC) {}
266
+ PassInstrumentationCallbacks *PIC = nullptr);
267
267
268
268
// / Cross register the analysis managers through their proxies.
269
269
// /
@@ -321,8 +321,7 @@ class PassBuilder {
321
321
// / \p Phase indicates the current ThinLTO phase.
322
322
FunctionPassManager
323
323
buildFunctionSimplificationPipeline (OptimizationLevel Level,
324
- ThinLTOPhase Phase,
325
- bool DebugLogging = false );
324
+ ThinLTOPhase Phase);
326
325
327
326
// / Construct the core LLVM module canonicalization and simplification
328
327
// / pipeline.
@@ -339,16 +338,13 @@ class PassBuilder {
339
338
// / build them.
340
339
// /
341
340
// / \p Phase indicates the current ThinLTO phase.
342
- ModulePassManager
343
- buildModuleSimplificationPipeline (OptimizationLevel Level,
344
- ThinLTOPhase Phase,
345
- bool DebugLogging = false );
341
+ ModulePassManager buildModuleSimplificationPipeline (OptimizationLevel Level,
342
+ ThinLTOPhase Phase);
346
343
347
344
// / Construct the module pipeline that performs inlining as well as
348
345
// / the inlining-driven cleanups.
349
346
ModuleInlinerWrapperPass buildInlinerPipeline (OptimizationLevel Level,
350
- ThinLTOPhase Phase,
351
- bool DebugLogging = false );
347
+ ThinLTOPhase Phase);
352
348
353
349
// / Construct the core LLVM module optimization pipeline.
354
350
// /
@@ -364,7 +360,6 @@ class PassBuilder {
364
360
// / require some transformations for semantic reasons, they should explicitly
365
361
// / build them.
366
362
ModulePassManager buildModuleOptimizationPipeline (OptimizationLevel Level,
367
- bool DebugLogging = false ,
368
363
bool LTOPreLink = false );
369
364
370
365
// / Build a per-module default optimization pipeline.
@@ -379,7 +374,6 @@ class PassBuilder {
379
374
// / require some transformations for semantic reasons, they should explicitly
380
375
// / build them.
381
376
ModulePassManager buildPerModuleDefaultPipeline (OptimizationLevel Level,
382
- bool DebugLogging = false ,
383
377
bool LTOPreLink = false );
384
378
385
379
// / Build a pre-link, ThinLTO-targeting default optimization pipeline to
@@ -394,9 +388,7 @@ class PassBuilder {
394
388
// / only intended for use when attempting to optimize code. If frontends
395
389
// / require some transformations for semantic reasons, they should explicitly
396
390
// / build them.
397
- ModulePassManager
398
- buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level,
399
- bool DebugLogging = false );
391
+ ModulePassManager buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level);
400
392
401
393
// / Build an ThinLTO default optimization pipeline to a pass manager.
402
394
// /
@@ -410,7 +402,7 @@ class PassBuilder {
410
402
// / require some transformations for semantic reasons, they should explicitly
411
403
// / build them.
412
404
ModulePassManager
413
- buildThinLTODefaultPipeline (OptimizationLevel Level, bool DebugLogging,
405
+ buildThinLTODefaultPipeline (OptimizationLevel Level,
414
406
const ModuleSummaryIndex *ImportSummary);
415
407
416
408
// / Build a pre-link, LTO-targeting default optimization pipeline to a pass
@@ -425,8 +417,7 @@ class PassBuilder {
425
417
// / only intended for use when attempting to optimize code. If frontends
426
418
// / require some transformations for semantic reasons, they should explicitly
427
419
// / build them.
428
- ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level,
429
- bool DebugLogging = false );
420
+ ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level);
430
421
431
422
// / Build an LTO default optimization pipeline to a pass manager.
432
423
// /
@@ -440,7 +431,6 @@ class PassBuilder {
440
431
// / require some transformations for semantic reasons, they should explicitly
441
432
// / build them.
442
433
ModulePassManager buildLTODefaultPipeline (OptimizationLevel Level,
443
- bool DebugLogging,
444
434
ModuleSummaryIndex *ExportSummary);
445
435
446
436
// / Build the default `AAManager` with the default alias analysis pipeline
@@ -487,8 +477,7 @@ class PassBuilder {
487
477
// / specifically want the pass to run under a adaptor directly. This is
488
478
// / preferred when a pipeline is largely of one type, but one or just a few
489
479
// / passes are of different types(See PassBuilder.cpp for examples).
490
- Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText,
491
- bool DebugLogging = false );
480
+ Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText);
492
481
493
482
// / {{@ Parse a textual pass pipeline description into a specific PassManager
494
483
// /
@@ -497,12 +486,9 @@ class PassBuilder {
497
486
// / this is the valid pipeline text:
498
487
// /
499
488
// / function(lpass)
500
- Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText,
501
- bool DebugLogging = false );
502
- Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText,
503
- bool DebugLogging = false );
504
- Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText,
505
- bool DebugLogging = false );
489
+ Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText);
490
+ Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText);
491
+ Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText);
506
492
// / @}}
507
493
508
494
// / Parse a textual alias analysis pipeline into the provided AA manager.
@@ -681,12 +667,10 @@ class PassBuilder {
681
667
bool DebugLogging)> &C);
682
668
683
669
// / Add PGOInstrumenation passes for O0 only.
684
- void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool DebugLogging,
685
- bool RunProfileGen, bool IsCS,
686
- std::string ProfileFile,
670
+ void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool RunProfileGen,
671
+ bool IsCS, std::string ProfileFile,
687
672
std::string ProfileRemappingFile);
688
673
689
-
690
674
// / Returns PIC. External libraries can use this to register pass
691
675
// / instrumentation callbacks.
692
676
PassInstrumentationCallbacks *getPassInstrumentationCallbacks () const {
@@ -695,38 +679,30 @@ class PassBuilder {
695
679
696
680
private:
697
681
// O1 pass pipeline
698
- FunctionPassManager buildO1FunctionSimplificationPipeline (
699
- OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging = false );
682
+ FunctionPassManager
683
+ buildO1FunctionSimplificationPipeline (OptimizationLevel Level,
684
+ ThinLTOPhase Phase);
700
685
701
686
static Optional<std::vector<PipelineElement>>
702
687
parsePipelineText (StringRef Text);
703
688
704
- Error parseModulePass (ModulePassManager &MPM, const PipelineElement &E,
705
- bool DebugLogging);
706
- Error parseCGSCCPass (CGSCCPassManager &CGPM, const PipelineElement &E,
707
- bool DebugLogging);
708
- Error parseFunctionPass (FunctionPassManager &FPM, const PipelineElement &E,
709
- bool DebugLogging);
710
- Error parseLoopPass (LoopPassManager &LPM, const PipelineElement &E,
711
- bool DebugLogging);
689
+ Error parseModulePass (ModulePassManager &MPM, const PipelineElement &E);
690
+ Error parseCGSCCPass (CGSCCPassManager &CGPM, const PipelineElement &E);
691
+ Error parseFunctionPass (FunctionPassManager &FPM, const PipelineElement &E);
692
+ Error parseLoopPass (LoopPassManager &LPM, const PipelineElement &E);
712
693
bool parseAAPassName (AAManager &AA, StringRef Name);
713
694
714
695
Error parseLoopPassPipeline (LoopPassManager &LPM,
715
- ArrayRef<PipelineElement> Pipeline,
716
- bool DebugLogging);
696
+ ArrayRef<PipelineElement> Pipeline);
717
697
Error parseFunctionPassPipeline (FunctionPassManager &FPM,
718
- ArrayRef<PipelineElement> Pipeline,
719
- bool DebugLogging);
698
+ ArrayRef<PipelineElement> Pipeline);
720
699
Error parseCGSCCPassPipeline (CGSCCPassManager &CGPM,
721
- ArrayRef<PipelineElement> Pipeline,
722
- bool DebugLogging);
700
+ ArrayRef<PipelineElement> Pipeline);
723
701
Error parseModulePassPipeline (ModulePassManager &MPM,
724
- ArrayRef<PipelineElement> Pipeline,
725
- bool DebugLogging);
702
+ ArrayRef<PipelineElement> Pipeline);
726
703
727
- void addPGOInstrPasses (ModulePassManager &MPM, bool DebugLogging,
728
- OptimizationLevel Level, bool RunProfileGen, bool IsCS,
729
- std::string ProfileFile,
704
+ void addPGOInstrPasses (ModulePassManager &MPM, OptimizationLevel Level,
705
+ bool RunProfileGen, bool IsCS, std::string ProfileFile,
730
706
std::string ProfileRemappingFile);
731
707
void invokePeepholeEPCallbacks (FunctionPassManager &, OptimizationLevel);
732
708
0 commit comments