Skip to content

Commit 3cabeab

Browse files
committed
fixup! [BOLT][AArch64] Add support for compact code model
1 parent 9c5b340 commit 3cabeab

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

bolt/lib/Passes/LongJmp.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,6 @@ void LongJmpPass::relaxLocalBranches(BinaryFunction &BF) {
641641
BinaryContext &BC = BF.getBinaryContext();
642642
auto &MIB = BC.MIB;
643643

644-
if (!BF.isSimple())
645-
return;
646-
647644
// Quick path.
648645
if (!BF.isSplit() && BF.estimateSize() < ShortestJumpSpan)
649646
return;
@@ -667,7 +664,7 @@ void LongJmpPass::relaxLocalBranches(BinaryFunction &BF) {
667664
// Function fragments are relaxed independently.
668665
for (FunctionFragment &FF : BF.getLayout().fragments()) {
669666
// Fill out code size estimation for the fragment. Use output BB address
670-
// ranges to store offsets from the start of the function.
667+
// ranges to store offsets from the start of the function fragment.
671668
uint64_t CodeSize = 0;
672669
for (BinaryBasicBlock *BB : FF) {
673670
BB->setOutputStartAddress(CodeSize);
@@ -757,8 +754,9 @@ void LongJmpPass::relaxLocalBranches(BinaryFunction &BF) {
757754
BB->replaceSuccessor(TargetBB, TrampolineBB, BI.Count);
758755
}
759756

760-
/// Relax the branch \p Inst. Return true if basic block offsets need an
761-
/// update after the trampoline insertion.
757+
/// Relax the branch \p Inst in basic block \p BB that targets \p TargetBB.
758+
/// \p InstAddress contains offset of the branch from the start of the
759+
/// containing function fragment.
762760
auto relaxBranch = [&](BinaryBasicBlock *BB, MCInst &Inst,
763761
uint64_t InstAddress, BinaryBasicBlock *TargetBB) {
764762
BinaryFunction *BF = BB->getParent();

0 commit comments

Comments
 (0)