[llvm] [BOLT][AArch64] Add support for compact code model (PR #112110)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 08:20:41 PDT 2024


https://github.com/paschalis-mpeis commented:


Just checking IIUC:
The compact mode processes locally all fragments of a function.
Unconditional branches are split with a trampoline.
Conditional branches (excluding indirects), are relaxed/split (using `relaxBranch`) with trampolines as needed, until we converge. During relaxation, it is attempted to add cold-branch trampolines at the end of the fragment. If out of range, those are added at the next block (just like with hot ones).

---

> Note that the new `.text` has to be smaller than 128MB

Could this be checked? Or do we pass this responsibility to the user since compact mode flag was their choice?

> produces slightly smaller code

Do we anticipate some trampoline duplication on unconditional branches to say common cold functions? Do we consistently expect code size to get smaller?
Also, I'm curious if those code size reductions are still observed since we have now merged:
- #96609


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


More information about the llvm-commits mailing list