1 # RUN: llc -mtriple=arm64-apple-ios -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
3 # Noreturn functions conservatively need to save and restore lr.
4 # When there is no available register, the stack is used at call site.
5 # If the stack also needs to be set up for a call in the outlined function,
6 # bail-out this case since we do not handle adjusting the stack twice.
8 # CHECK-NOT: OUTLINED_FUNCTION
11 @g = external global i32
12 define void @stack_1() #0 { ret void }
13 define void @stack_2() #0 { ret void }
14 define void @baz() { ret void }
15 attributes #0 = { noredzone noreturn }
19 tracksRegLiveness: true
22 liveins: $x4, $x0, $x1, $x2, $x3
24 $x9 = ADRP target-flags(aarch64-page) @g
25 $x9 = ADDXri $x9, target-flags(aarch64-pageoff, aarch64-nc) @g, 0
28 $w8 = ORRWrs $wzr, $w4, 0, implicit-def $x8
30 STPXi $x3, $xzr, $x2, 0
33 $x8 = ORRXrs $xzr, $x0, 0
34 $x0 = ORRXrs $xzr, $x1, 0
35 $x1 = ORRXrs $xzr, $x2, 0
36 BL @baz, implicit-def dead $lr, implicit $sp, implicit $x8, implicit $x0, implicit $x1, implicit $x3, implicit $x4, implicit-def $sp, implicit-def $x5, implicit-def $x6, implicit-def $x7, implicit-def $x8, implicit-def $x9, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit-def $x13, implicit-def $x14, implicit-def $x15, implicit-def $x18
41 tracksRegLiveness: true
44 liveins: $x4, $x0, $x1, $x2, $x3
46 $x9 = ADRP target-flags(aarch64-page) @g
47 $x9 = ADDXri $x9, target-flags(aarch64-pageoff, aarch64-nc) @g, 0
50 $w8 = ORRWrs $wzr, $w4, 0, implicit-def $x8
52 STPXi $x3, $xzr, $x2, 0
55 $x8 = ORRXrs $xzr, $x0, 0
56 $x0 = ORRXrs $xzr, $x1, 0
57 $x1 = ORRXrs $xzr, $x2, 0
58 BL @baz, implicit-def dead $lr, implicit $sp, implicit $x8, implicit $x0, implicit $x1, implicit $x3, implicit $x4, implicit-def $sp, implicit-def $x5, implicit-def $x6, implicit-def $x7, implicit-def $x8, implicit-def $x9, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit-def $x13, implicit-def $x14, implicit-def $x15, implicit-def $x18
63 tracksRegLiveness: true
66 liveins: $w0, $lr, $w8