aboutsummaryrefslogtreecommitdiff
path: root/bolt/lib/Passes/SplitFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Passes/SplitFunctions.cpp')
-rw-r--r--bolt/lib/Passes/SplitFunctions.cpp35
1 files changed, 6 insertions, 29 deletions
diff --git a/bolt/lib/Passes/SplitFunctions.cpp b/bolt/lib/Passes/SplitFunctions.cpp
index b21401e..eab669b 100644
--- a/bolt/lib/Passes/SplitFunctions.cpp
+++ b/bolt/lib/Passes/SplitFunctions.cpp
@@ -86,29 +86,6 @@ static cl::opt<unsigned> SplitThreshold(
"increase after splitting."),
cl::init(0), cl::Hidden, cl::cat(BoltOptCategory));
-static cl::opt<SplitFunctionsStrategy> SplitStrategy(
- "split-strategy", cl::init(SplitFunctionsStrategy::Profile2),
- cl::values(clEnumValN(SplitFunctionsStrategy::Profile2, "profile2",
- "split each function into a hot and cold fragment "
- "using profiling information")),
- cl::values(clEnumValN(SplitFunctionsStrategy::CDSplit, "cdsplit",
- "split each function into a hot, warm, and cold "
- "fragment using profiling information")),
- cl::values(clEnumValN(
- SplitFunctionsStrategy::Random2, "random2",
- "split each function into a hot and cold fragment at a randomly chosen "
- "split point (ignoring any available profiling information)")),
- cl::values(clEnumValN(
- SplitFunctionsStrategy::RandomN, "randomN",
- "split each function into N fragments at a randomly chosen split "
- "points (ignoring any available profiling information)")),
- cl::values(clEnumValN(
- SplitFunctionsStrategy::All, "all",
- "split all basic blocks of each function into fragments such that each "
- "fragment contains exactly a single basic block")),
- cl::desc("strategy used to partition blocks into fragments"),
- cl::cat(BoltOptCategory));
-
static cl::opt<double> CallScale(
"call-scale",
cl::desc("Call score scale coefficient (when --split-strategy=cdsplit)"),
@@ -724,14 +701,14 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
// If split strategy is not CDSplit, then a second run of the pass is not
// needed after function reordering.
if (BC.HasFinalizedFunctionOrder &&
- opts::SplitStrategy != SplitFunctionsStrategy::CDSplit)
+ opts::SplitStrategy != opts::SplitFunctionsStrategy::CDSplit)
return Error::success();
std::unique_ptr<SplitStrategy> Strategy;
bool ForceSequential = false;
switch (opts::SplitStrategy) {
- case SplitFunctionsStrategy::CDSplit:
+ case opts::SplitFunctionsStrategy::CDSplit:
// CDSplit runs two splitting passes: hot-cold splitting (SplitPrfoile2)
// before function reordering and hot-warm-cold splitting
// (SplitCacheDirected) after function reordering.
@@ -742,21 +719,21 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
opts::AggressiveSplitting = true;
BC.HasWarmSection = true;
break;
- case SplitFunctionsStrategy::Profile2:
+ case opts::SplitFunctionsStrategy::Profile2:
Strategy = std::make_unique<SplitProfile2>();
break;
- case SplitFunctionsStrategy::Random2:
+ case opts::SplitFunctionsStrategy::Random2:
Strategy = std::make_unique<SplitRandom2>();
// If we split functions randomly, we need to ensure that across runs with
// the same input, we generate random numbers for each function in the same
// order.
ForceSequential = true;
break;
- case SplitFunctionsStrategy::RandomN:
+ case opts::SplitFunctionsStrategy::RandomN:
Strategy = std::make_unique<SplitRandomN>();
ForceSequential = true;
break;
- case SplitFunctionsStrategy::All:
+ case opts::SplitFunctionsStrategy::All:
Strategy = std::make_unique<SplitAll>();
break;
}