[llvm] [BOLT][AArch64] Relax calls and branches with fragment clusters (PR #215825)
Alexandros Lamprineas via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 01:01:50 PDT 2026
labrinea wrote:
> > Hi @rafaelauler, I appreciate there's a lot of change here, and I am happy to break it down for making the review easier. The intention is to replace the non-compact LongJmp pass. I could raise a corresponding RFC to get more opinions if needed. Let's treat it as a proposal for now.
>
> No worries, I can take a look sometime this week. But before I do, which one should I look at, this one or 218232? Are they working on the same problem by any chance? Thanks!
Thanks Rafael!
They are related, but they are trying to solve the range-extension problem from different directions.
My understanding is that Adam's patch improves the layout-distance estimation in the non-compact LongJmp path by making it better match RewriteInstance's final layout decisions. I am going to look at that patch more closely this week too.
This patch takes a different approach. It generalizes the call relaxation pass you recently merged and uses fragment clusters rather than whole-function clusters. The idea is to reuse relaxLocalBranches() to lower short local branches to local stubs first, then relax the remaining direct 28-bit edges with thunk chains. In particular, for a relaxed short branch, the assumption is only that the source -> stub edge stays local and in range. The stub -> target edge is not assumed to be in range; that is the edge this patch further relaxes.
The same cluster machinery is also used for calls, where we can use short or long thunks as needed.
I hope that helps. Let me know if you have more questions.
https://github.com/llvm/llvm-project/pull/215825
More information about the llvm-commits
mailing list