[llvm] [AArch64] Stop reserved registers from being saved in prolog/epilog (PR #138448)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 08:13:47 PDT 2025


smithp35 wrote:

> > GCC for AArch64 does seem to callee save these registers
> 
> @smithp35, do you mean it doesn't? (https://godbolt.org/z/6PWT4WP1h) If I'm not mistaken, I don't see x28 (callee-saved reg) being saved or restored anywhere in the GCC assembly, regardless if it's a local or global variable. This pull request is specifically for that GCC behavior, which llvm's riscv64 target follows (https://godbolt.org/z/cxeqnc6hT).
> 
My apologies I must have interpreted the top window of my compiler explorer example as clang.

I did ask the GCC team about the intended behaviour. There wasn't any clear specification of how it should behave and using callee-save registers is at the users own risk.


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


More information about the llvm-commits mailing list