[llvm] [AArch64][PAC] Move emission of LR checks in tail calls to AsmPrinter (PR #110705)

Anatoly Trosinenko via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 10:20:47 PST 2024


atrosinenko wrote:

I have just rebased the PR onto current `main` branch (the first three commits are exactly the same, except for conflict resolution with 5192cb772ad58af4b557539791ff8de60ab450a3) and added a few improvements, sorry for the delay.

According to code size metrics collected by building llvm-test-suite at different optimization levels, restricting `$AddrDisc` operand's register class actually regressed the code size. Restricting the call target, on the other hand, turned out to have negligible impact on `.text` section size (and only in a couple of tests). Thus, I updated the definition of `AUTH_TCRETURN` to avoid regressing the code size.

Presently, the PR still restricts the register class of `$AddrDisc` of `AUTH_TCRETURN_BTI`, which could still regress the code size when BTI is enabled, though the original implementation in `AArch64PointerAuth` pass turned out to be equally affected by this bug, so restricting `$AddrDisc` makes it correct at least. I added a test that catches the bug both for `AUTH_TCRETURN` and `AUTH_TCRETURN_BTI`.

@kovdan01 Are you OK with the changes?

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


More information about the llvm-commits mailing list