@@ -86,29 +86,6 @@ static cl::opt<unsigned> SplitThreshold(
8686 " increase after splitting." ),
8787 cl::init(0 ), cl::Hidden, cl::cat(BoltOptCategory));
8888
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-
11289static cl::opt<double > CallScale (
11390 " call-scale" ,
11491 cl::desc (" Call score scale coefficient (when --split-strategy=cdsplit)" ),
@@ -724,14 +701,14 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
724701 // If split strategy is not CDSplit, then a second run of the pass is not
725702 // needed after function reordering.
726703 if (BC.HasFinalizedFunctionOrder &&
727- opts::SplitStrategy != SplitFunctionsStrategy::CDSplit)
704+ opts::SplitStrategy != opts:: SplitFunctionsStrategy::CDSplit)
728705 return Error::success ();
729706
730707 std::unique_ptr<SplitStrategy> Strategy;
731708 bool ForceSequential = false ;
732709
733710 switch (opts::SplitStrategy) {
734- case SplitFunctionsStrategy::CDSplit:
711+ case opts:: SplitFunctionsStrategy::CDSplit:
735712 // CDSplit runs two splitting passes: hot-cold splitting (SplitPrfoile2)
736713 // before function reordering and hot-warm-cold splitting
737714 // (SplitCacheDirected) after function reordering.
@@ -742,21 +719,21 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
742719 opts::AggressiveSplitting = true ;
743720 BC.HasWarmSection = true ;
744721 break ;
745- case SplitFunctionsStrategy::Profile2:
722+ case opts:: SplitFunctionsStrategy::Profile2:
746723 Strategy = std::make_unique<SplitProfile2>();
747724 break ;
748- case SplitFunctionsStrategy::Random2:
725+ case opts:: SplitFunctionsStrategy::Random2:
749726 Strategy = std::make_unique<SplitRandom2>();
750727 // If we split functions randomly, we need to ensure that across runs with
751728 // the same input, we generate random numbers for each function in the same
752729 // order.
753730 ForceSequential = true ;
754731 break ;
755- case SplitFunctionsStrategy::RandomN:
732+ case opts:: SplitFunctionsStrategy::RandomN:
756733 Strategy = std::make_unique<SplitRandomN>();
757734 ForceSequential = true ;
758735 break ;
759- case SplitFunctionsStrategy::All:
736+ case opts:: SplitFunctionsStrategy::All:
760737 Strategy = std::make_unique<SplitAll>();
761738 break ;
762739 }
0 commit comments