[BOLT][AArch64] Enable function print after ADRRelaxation (#119869)
Introduce `--print-adr-relaxation` to print after ADR Relaxation pass.
This commit is contained in:
@@ -25,7 +25,8 @@ namespace bolt {
|
||||
|
||||
class ADRRelaxationPass : public BinaryFunctionPass {
|
||||
public:
|
||||
explicit ADRRelaxationPass() : BinaryFunctionPass(false) {}
|
||||
explicit ADRRelaxationPass(const cl::opt<bool> &PrintPass)
|
||||
: BinaryFunctionPass(PrintPass) {}
|
||||
|
||||
const char *getName() const override { return "adr-relaxation"; }
|
||||
|
||||
|
||||
@@ -126,6 +126,11 @@ static cl::opt<bool> PrintJTFootprintReduction(
|
||||
cl::desc("print function after jt-footprint-reduction pass"), cl::Hidden,
|
||||
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,
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user