[llvm] [AArch64][PAC] Protect the entire function if pac-ret+leaf is passed (PR #140895)
Anatoly Trosinenko via llvm-commits
llvm-commits at lists.llvm.org
Wed May 21 06:31:31 PDT 2025
atrosinenko wrote:
As seen in `sign-return-address-cfi-negate-ra-state.ll`, this patch moves `.cfi_restore w30` above `autiasp` in the epilogue, but this doesn't seem to violate the specs:
* AArch64 DWARF documentation defines a separate `RA_SIGN_STATE` pseudo register, and `DW_CFA_AARCH64_negate_ra_state` and `DW_CFA_AARCH64_negate_ra_state_with_pc` call frame instructions operate on that register's value
* when LR is spilled to the stack in the function prologue (see [this test case](https://github.com/llvm/llvm-project/blob/dc29901efb18880679b965538ae8bc3f6dd5ecd8/llvm/test/CodeGen/AArch64/sign-return-address.ll#L78) for example), a `.cfi_offset w30, -16` directive is emitted. According to the DWARF 4 specification, Section 6.4.2.3 the action for `DW_CFA_offset` is described as "change the rule for the register indicated by the register number to be an offset(N) rule", that is, it overwrites the existing rule
https://github.com/llvm/llvm-project/pull/140895
More information about the llvm-commits
mailing list