[llvm] [BOLT][AArch64] Relax calls and branches with fragment clusters (PR #215825)

Adam Bzowski via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 14:02:49 PDT 2026


adam-bzowski-arm wrote:

It seems that the branch from one function into the beginning of another function is treated as a tail call and can be relaxed via ADRP+ADD. On the other hand the branch into the function's body is always relaxed by the ladder of B's. I think this should be consistent: either be conservative and use ADRP+ADD for BLs only, or yolo, and rely on `MCPlusBuilder::isTailCall`.

I have a comment about style and the wrapper class `ClusteredRelaxation`. LLVM's coding guide does not prohibit using wrapper classes, but for small passes, such as LongJmp, one usually uses the pass class as the environment where all the data and methods are contained. The actual problem with the BOLT's design is that the header exposes the entire pass class, even though no method or data is accessed from outside of the class. LLVM recommends giving the class the smallest possible visibility, which means that the only thing that the header should expose is `std::unique_ptr<BinaryFunctionPass> createLongJmpPass();`.

https://github.com/llvm/llvm-project/pull/215825


More information about the llvm-commits mailing list