[llvm] [AArch64] New pass for code layout optimizations. (PR #184434)

Ahmad Yasin via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 02:54:33 PDT 2026


ayasin-a wrote:

> > The artificial-induced padding at link time I described above is applied once at the start of the binary
> 
> How much? Does that not imply that the first function with a alignment set on it will force a similar alignment for all following functions, if the padding was less than the alignment added? So any alignment you are adding is really just undoing the padding and you are not seeing an effect from more than the first function.

The padding is done by a tool that randomizes number of NOPs to include into an artificial .o file that is prepended to the link command. I referred to these as variants in the results table above (where we had 30 of them fed by same compilation).

Such padding shifts alignment of addresses in the entire binary by some random amount, unless a specific alignment is requested. Apple targets do not align functions/loops by default. 

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


More information about the llvm-commits mailing list