@@ -86,29 +86,6 @@ static cl::opt<unsigned> SplitThreshold(
86
86
" increase after splitting." ),
87
87
cl::init(0 ), cl::Hidden, cl::cat(BoltOptCategory));
88
88
89
- static cl::opt<SplitFunctionsStrategy> SplitStrategy (
90
- " split-strategy" , cl::init(SplitFunctionsStrategy::Profile2),
91
- cl::values(clEnumValN(SplitFunctionsStrategy::Profile2, " profile2" ,
92
- " split each function into a hot and cold fragment "
93
- " using profiling information" )),
94
- cl::values(clEnumValN(SplitFunctionsStrategy::CDSplit, " cdsplit" ,
95
- " split each function into a hot, warm, and cold "
96
- " fragment using profiling information" )),
97
- cl::values(clEnumValN(
98
- SplitFunctionsStrategy::Random2, " random2" ,
99
- " split each function into a hot and cold fragment at a randomly chosen "
100
- " split point (ignoring any available profiling information)" )),
101
- cl::values(clEnumValN(
102
- SplitFunctionsStrategy::RandomN, " randomN" ,
103
- " split each function into N fragments at a randomly chosen split "
104
- " points (ignoring any available profiling information)" )),
105
- cl::values(clEnumValN(
106
- SplitFunctionsStrategy::All, " all" ,
107
- " split all basic blocks of each function into fragments such that each "
108
- " fragment contains exactly a single basic block" )),
109
- cl::desc(" strategy used to partition blocks into fragments" ),
110
- cl::cat(BoltOptCategory));
111
-
112
89
static cl::opt<double > CallScale (
113
90
" call-scale" ,
114
91
cl::desc (" Call score scale coefficient (when --split-strategy=cdsplit)" ),
@@ -724,14 +701,14 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
724
701
// If split strategy is not CDSplit, then a second run of the pass is not
725
702
// needed after function reordering.
726
703
if (BC.HasFinalizedFunctionOrder &&
727
- opts::SplitStrategy != SplitFunctionsStrategy::CDSplit)
704
+ opts::SplitStrategy != opts:: SplitFunctionsStrategy::CDSplit)
728
705
return Error::success ();
729
706
730
707
std::unique_ptr<SplitStrategy> Strategy;
731
708
bool ForceSequential = false ;
732
709
733
710
switch (opts::SplitStrategy) {
734
- case SplitFunctionsStrategy::CDSplit:
711
+ case opts:: SplitFunctionsStrategy::CDSplit:
735
712
// CDSplit runs two splitting passes: hot-cold splitting (SplitPrfoile2)
736
713
// before function reordering and hot-warm-cold splitting
737
714
// (SplitCacheDirected) after function reordering.
@@ -742,21 +719,21 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
742
719
opts::AggressiveSplitting = true ;
743
720
BC.HasWarmSection = true ;
744
721
break ;
745
- case SplitFunctionsStrategy::Profile2:
722
+ case opts:: SplitFunctionsStrategy::Profile2:
746
723
Strategy = std::make_unique<SplitProfile2>();
747
724
break ;
748
- case SplitFunctionsStrategy::Random2:
725
+ case opts:: SplitFunctionsStrategy::Random2:
749
726
Strategy = std::make_unique<SplitRandom2>();
750
727
// If we split functions randomly, we need to ensure that across runs with
751
728
// the same input, we generate random numbers for each function in the same
752
729
// order.
753
730
ForceSequential = true ;
754
731
break ;
755
- case SplitFunctionsStrategy::RandomN:
732
+ case opts:: SplitFunctionsStrategy::RandomN:
756
733
Strategy = std::make_unique<SplitRandomN>();
757
734
ForceSequential = true ;
758
735
break ;
759
- case SplitFunctionsStrategy::All:
736
+ case opts:: SplitFunctionsStrategy::All:
760
737
Strategy = std::make_unique<SplitAll>();
761
738
break ;
762
739
}
0 commit comments