[llvm] [AArch64] Use a frame record for non-leaf outlined functions on MachO (PR #213711)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 08:19:17 PDT 2026
ellishg wrote:
> I have a downstream patch that does essentially the same thing as this PR. Some background on how we got there: when app teams adopted the Xcode 16 toolchain, the outliner started producing many more frame-creating outlined sequences, and our downstream ld64 fork couldn't fold them. The root cause was that ld64's ICF has no support for folding FDEs, so every FDE-bearing outlined function stayed distinct. My downstream patch works around that in codegen the same way this PR does: emit a frame record so the function gets a compact unwind encoding and no FDE.
> One question about the description: it attributes the __text win to FDE-bearing functions being unfoldable under ICF, but as far as I can tell that's not the case with current linkers: I've verified LLD folds FDE-bearing functions, and ld-prime does as well. So I'm not sure where the __text delta actually comes from; it would be good to understand the mechanism before this lands.
@nocchijiang I actually found that LLD doesn't fold FDEs, at least for Mach-O. In fact, I have a WIP PR to support this https://github.com/llvm/llvm-project/pull/213778. The two of these patches significantly improve `__text` size due to ICF being able to fold these functions.
https://github.com/llvm/llvm-project/pull/213711
More information about the llvm-commits
mailing list