[clang] [llvm] [ARM, AArch64] Don't put BTI at asm goto branch targets (PR #141562)

Mark Rutland via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 07:36:42 PDT 2025


mrutland-arm wrote:

I've given this a test, building a v6.15 defconfig arm64 Linux kernel with LLVM built with and without this change, and the reduction is impressive:

|                 | before | after | change |
| - | - | - | - |
| `BTI J` instructions | 23,323          | 4,207              | -19,116 (-82%) |
| .text size (bytes)      | 20,418,121   | 20,343,417    | -74,704 (-0.37%) |
| Image size (bytes)   | 39,195,136   | 39,129,600   | -65,536 (-0.17%) |
| vmlinux size (bytes) | 411,181,384 | 409,784,800 | -1,396,584 (-0.34%) | 

I've also given that kernel a basic boot test on a model with BTI support, and all looks well so far.

I do not current have BTI-capable hardware, so I'm not able to get performance figures. Regardless, I think this is pretty clearly a win.

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


More information about the llvm-commits mailing list