diff options
Diffstat (limited to 'bolt/lib/Passes/SplitFunctions.cpp')
| -rw-r--r-- | bolt/lib/Passes/SplitFunctions.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/bolt/lib/Passes/SplitFunctions.cpp b/bolt/lib/Passes/SplitFunctions.cpp index 5de075973004..cdbb2a15f667 100644 --- a/bolt/lib/Passes/SplitFunctions.cpp +++ b/bolt/lib/Passes/SplitFunctions.cpp @@ -712,15 +712,15 @@ bool SplitFunctions::shouldOptimize(const BinaryFunction &BF) const { return BinaryFunctionPass::shouldOptimize(BF); } -void SplitFunctions::runOnFunctions(BinaryContext &BC) { +Error SplitFunctions::runOnFunctions(BinaryContext &BC) { if (!opts::SplitFunctions) - return; + return Error::success(); // 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) - return; + return Error::success(); std::unique_ptr<SplitStrategy> Strategy; bool ForceSequential = false; @@ -766,10 +766,12 @@ void SplitFunctions::runOnFunctions(BinaryContext &BC) { "SplitFunctions", ForceSequential); if (SplitBytesHot + SplitBytesCold > 0) - outs() << "BOLT-INFO: splitting separates " << SplitBytesHot - << " hot bytes from " << SplitBytesCold << " cold bytes " - << format("(%.2lf%% of split functions is hot).\n", - 100.0 * SplitBytesHot / (SplitBytesHot + SplitBytesCold)); + BC.outs() << "BOLT-INFO: splitting separates " << SplitBytesHot + << " hot bytes from " << SplitBytesCold << " cold bytes " + << format("(%.2lf%% of split functions is hot).\n", + 100.0 * SplitBytesHot / + (SplitBytesHot + SplitBytesCold)); + return Error::success(); } void SplitFunctions::splitFunction(BinaryFunction &BF, SplitStrategy &S) { @@ -899,9 +901,9 @@ void SplitFunctions::splitFunction(BinaryFunction &BF, SplitStrategy &S) { if (alignTo(OriginalHotSize, opts::SplitAlignThreshold) <= alignTo(HotSize, opts::SplitAlignThreshold) + opts::SplitThreshold) { if (opts::Verbosity >= 2) { - outs() << "BOLT-INFO: Reversing splitting of function " - << formatv("{0}:\n {1:x}, {2:x} -> {3:x}\n", BF, HotSize, - ColdSize, OriginalHotSize); + BC.outs() << "BOLT-INFO: Reversing splitting of function " + << formatv("{0}:\n {1:x}, {2:x} -> {3:x}\n", BF, HotSize, + ColdSize, OriginalHotSize); } // Reverse the action of createEHTrampolines(). The trampolines will be |
