summaryrefslogtreecommitdiff
path: root/bolt/lib/Passes/IdenticalCodeFolding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Passes/IdenticalCodeFolding.cpp')
-rw-r--r--bolt/lib/Passes/IdenticalCodeFolding.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/bolt/lib/Passes/IdenticalCodeFolding.cpp b/bolt/lib/Passes/IdenticalCodeFolding.cpp
index dfbc72e48e5d..9f8d82b05ccf 100644
--- a/bolt/lib/Passes/IdenticalCodeFolding.cpp
+++ b/bolt/lib/Passes/IdenticalCodeFolding.cpp
@@ -341,7 +341,7 @@ typedef std::unordered_map<BinaryFunction *, std::vector<BinaryFunction *>,
namespace llvm {
namespace bolt {
-void IdenticalCodeFolding::runOnFunctions(BinaryContext &BC) {
+Error IdenticalCodeFolding::runOnFunctions(BinaryContext &BC) {
const size_t OriginalFunctionCount = BC.getBinaryFunctions().size();
uint64_t NumFunctionsFolded = 0;
std::atomic<uint64_t> NumJTFunctionsFolded{0};
@@ -508,14 +508,16 @@ void IdenticalCodeFolding::runOnFunctions(BinaryContext &BC) {
});
if (NumFunctionsFolded)
- outs() << "BOLT-INFO: ICF folded " << NumFunctionsFolded << " out of "
- << OriginalFunctionCount << " functions in " << Iteration
- << " passes. " << NumJTFunctionsFolded
- << " functions had jump tables.\n"
- << "BOLT-INFO: Removing all identical functions will save "
- << format("%.2lf", (double)BytesSavedEstimate / 1024)
- << " KB of code space. Folded functions were called " << NumCalled
- << " times based on profile.\n";
+ BC.outs() << "BOLT-INFO: ICF folded " << NumFunctionsFolded << " out of "
+ << OriginalFunctionCount << " functions in " << Iteration
+ << " passes. " << NumJTFunctionsFolded
+ << " functions had jump tables.\n"
+ << "BOLT-INFO: Removing all identical functions will save "
+ << format("%.2lf", (double)BytesSavedEstimate / 1024)
+ << " KB of code space. Folded functions were called " << NumCalled
+ << " times based on profile.\n";
+
+ return Error::success();
}
} // namespace bolt