summaryrefslogtreecommitdiff
path: root/bolt/lib/Rewrite/BinaryPassManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Rewrite/BinaryPassManager.cpp')
-rw-r--r--bolt/lib/Rewrite/BinaryPassManager.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/bolt/lib/Rewrite/BinaryPassManager.cpp b/bolt/lib/Rewrite/BinaryPassManager.cpp
index b09060418334..2d851c751ae1 100644
--- a/bolt/lib/Rewrite/BinaryPassManager.cpp
+++ b/bolt/lib/Rewrite/BinaryPassManager.cpp
@@ -54,6 +54,9 @@ extern cl::opt<bool> PrintDynoStats;
extern cl::opt<bool> DumpDotAll;
extern cl::opt<std::string> AsmDump;
extern cl::opt<bolt::PLTCall::OptType> PLT;
+extern cl::opt<bolt::IdenticalCodeFolding::ICFLevel, false,
+ llvm::bolt::DeprecatedICFNumericOptionParser>
+ ICF;
static cl::opt<bool>
DynoStatsAll("dyno-stats-all",
@@ -65,9 +68,6 @@ static cl::opt<bool>
cl::desc("eliminate unreachable code"), cl::init(true),
cl::cat(BoltOptCategory));
-cl::opt<bool> ICF("icf", cl::desc("fold functions with identical code"),
- cl::cat(BoltOptCategory));
-
static cl::opt<bool> JTFootprintReductionFlag(
"jt-footprint-reduction",
cl::desc("make jump tables size smaller at the cost of using more "
@@ -127,6 +127,11 @@ static cl::opt<bool> PrintJTFootprintReduction(
cl::cat(BoltOptCategory));
static cl::opt<bool>
+ PrintAdrRelaxation("print-adr-relaxation",
+ cl::desc("print functions after ADR Relaxation pass"),
+ cl::Hidden, cl::cat(BoltOptCategory));
+
+static cl::opt<bool>
PrintLongJmp("print-longjmp",
cl::desc("print functions after longjmp pass"), cl::Hidden,
cl::cat(BoltOptCategory));
@@ -398,7 +403,7 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
opts::StripRepRet);
Manager.registerPass(std::make_unique<IdenticalCodeFolding>(PrintICF),
- opts::ICF);
+ opts::ICF != IdenticalCodeFolding::ICFLevel::None);
Manager.registerPass(
std::make_unique<SpecializeMemcpy1>(NeverPrint, opts::SpecializeMemcpy1),
@@ -423,7 +428,7 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
Manager.registerPass(std::make_unique<Inliner>(PrintInline));
Manager.registerPass(std::make_unique<IdenticalCodeFolding>(PrintICF),
- opts::ICF);
+ opts::ICF != IdenticalCodeFolding::ICFLevel::None);
Manager.registerPass(std::make_unique<PLTCall>(PrintPLT));
@@ -493,7 +498,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
Manager.registerPass(std::make_unique<ReorderData>());
if (BC.isAArch64()) {
- Manager.registerPass(std::make_unique<ADRRelaxationPass>());
+ Manager.registerPass(
+ std::make_unique<ADRRelaxationPass>(PrintAdrRelaxation));
// Tighten branches according to offset differences between branch and
// targets. No extra instructions after this pass, otherwise we may have