File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ namespace bolt {
25
25
26
26
class ADRRelaxationPass : public BinaryFunctionPass {
27
27
public:
28
- explicit ADRRelaxationPass () : BinaryFunctionPass(false ) {}
28
+ explicit ADRRelaxationPass (const cl::opt<bool > &PrintPass)
29
+ : BinaryFunctionPass(PrintPass) {}
29
30
30
31
const char *getName () const override { return " adr-relaxation" ; }
31
32
Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ static cl::opt<bool> PrintJTFootprintReduction(
126
126
cl::desc (" print function after jt-footprint-reduction pass" ), cl::Hidden,
127
127
cl::cat(BoltOptCategory));
128
128
129
+ static cl::opt<bool >
130
+ PrintAdrRelaxation (" print-adr-relaxation" ,
131
+ cl::desc (" print functions after ADR Relaxation pass" ),
132
+ cl::Hidden, cl::cat(BoltOptCategory));
133
+
129
134
static cl::opt<bool >
130
135
PrintLongJmp (" print-longjmp" ,
131
136
cl::desc (" print functions after longjmp pass" ), cl::Hidden,
@@ -493,7 +498,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
493
498
Manager.registerPass (std::make_unique<ReorderData>());
494
499
495
500
if (BC.isAArch64 ()) {
496
- Manager.registerPass (std::make_unique<ADRRelaxationPass>());
501
+ Manager.registerPass (
502
+ std::make_unique<ADRRelaxationPass>(PrintAdrRelaxation));
497
503
498
504
// Tighten branches according to offset differences between branch and
499
505
// targets. No extra instructions after this pass, otherwise we may have
You can’t perform that action at this time.
0 commit comments