Skip to content

Commit 750b12f

Browse files
authored
[BOLT] Move ADRRelaxationPass (#101371)
For non-simple functions we need nop instruction to be presented to transform ADR to ADRP+ADD sequence, so run this pass before remove nops pass.
1 parent 8a5f33f commit 750b12f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bolt/lib/Rewrite/BinaryPassManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
357357

358358
Manager.registerPass(
359359
std::make_unique<VeneerElimination>(PrintVeneerElimination));
360+
361+
Manager.registerPass(std::make_unique<ADRRelaxationPass>());
360362
}
361363

362364
if (BC.isRISCV()) {
@@ -490,8 +492,6 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
490492
Manager.registerPass(std::make_unique<ReorderData>());
491493

492494
if (BC.isAArch64()) {
493-
Manager.registerPass(std::make_unique<ADRRelaxationPass>());
494-
495495
// Tighten branches according to offset differences between branch and
496496
// targets. No extra instructions after this pass, otherwise we may have
497497
// relocations out of range and crash during linking.

0 commit comments

Comments
 (0)