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

Anatoly Trosinenko via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 7 08:36:50 PDT 2024


atrosinenko wrote:

Considering the reproducer, the code became a bit longer but correct:

<spoiler>
```
_ZN7myshape4moveEv:                     // @_ZN7myshape4moveEv
        .cfi_startproc
// %bb.0:                               // %entry
        .cfi_b_key_frame
        pacibsp
        stp     x30, x19, [sp, #-16]!           // 16-byte Folded Spill
        .cfi_negate_ra_state
        .cfi_def_cfa_offset 16
        .cfi_offset w19, -8
        .cfi_offset w30, -16
        mov     x19, x0
        ldr     x0, [x0]
        ldr     x16, [x0]
        mov     x17, x0
        movk    x17, #50297, lsl #48
        autda   x16, x17
        mov     x17, x16
        xpacd   x17
        cmp     x16, x17
        b.eq    .Lauth_success_0
        brk     #0xc472
.Lauth_success_0:
        ldr     x9, [x16]
        mov     x8, x16
        mov     x17, x8
        movk    x17, #36564, lsl #48
        blraa   x9, x17
        ldr     x0, [x19, #8]
        ldr     x16, [x0]
        mov     x17, x0
        movk    x17, #50297, lsl #48
        autda   x16, x17
        mov     x17, x16
        xpacd   x17
        cmp     x16, x17
        b.eq    .Lauth_success_1
        brk     #0xc472
.Lauth_success_1:
        ldr     x2, [x16]
        mov     x1, x16
        ldp     x30, x19, [sp], #16             // 16-byte Folded Reload
        autibsp
        eor     x16, x30, x30, lsl #1
        tbz     x16, #62, .Lauth_success_2
        brk     #0xc471
.Lauth_success_2:
        mov     x16, x1
        movk    x16, #36564, lsl #48
        braa    x2, x16
```
</spoiler>

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


More information about the llvm-branch-commits mailing list