xref: /llvm-project/llvm/test/CodeGen/AArch64/arm64-homogeneous-prolog-epilog-bad-outline.mir (revision 1ee315ae7964c8433b772e0b5d667834994ba753)
1# RUN: llc -mtriple=arm64-applie-ios7.0 -start-before=aarch64-lower-homogeneous-prolog-epilog -homogeneous-prolog-epilog %s -o - | FileCheck %s
2#
3# This test ensure no outlined epilog is formed when X16 is live across the helper.
4--- |
5  @FuncPtr = local_unnamed_addr global ptr null, align 8
6
7  define i32 @_Z3fooi(i32) minsize "frame-pointer"="all" {
8    ret i32 0
9  }
10
11  declare i32 @_Z3gooii(i32, i32)
12...
13---
14name:            _Z3fooi
15tracksRegLiveness: true
16body:             |
17  bb.0:
18    liveins: $w0, $lr, $x19, $x20
19    successors: %bb.1
20    frame-setup HOM_Prolog $lr, $fp, $x19, $x20, 16
21    frame-setup CFI_INSTRUCTION def_cfa $w29, 16
22    frame-setup CFI_INSTRUCTION offset $w30, -8
23    frame-setup CFI_INSTRUCTION offset $w29, -16
24    frame-setup CFI_INSTRUCTION offset $w19, -24
25    frame-setup CFI_INSTRUCTION offset $w20, -32
26    $w19 = nsw ADDWri $w0, 1, 0
27    $w1 = ORRWrr $wzr, $w0
28    $w0 = ORRWrr $wzr, $w19
29    BL @_Z3gooii, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def $sp, implicit-def $w0
30    $x8 = ADRP target-flags(aarch64-page) @FuncPtr
31    $x16 = LDRXui killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @FuncPtr
32    $w0 = nsw ADDWrr renamable $w0, killed renamable $w19
33    $lr, $fp, $x19, $x20 = frame-destroy HOM_Epilog
34    B %bb.1
35
36  bb.1:
37    liveins: $w0, $x16
38    TCRETURNri killed renamable $x16, 0, csr_aarch64_aapcs, implicit $sp, implicit $w0
39# CHECK: _OUTLINED_FUNCTION_PROLOG_FRAME16_x30x29x19x20:
40# CHECK-NOT: _OUTLINED_FUNCTION_EPILOG_x30x29x19x20:
41