1 # RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner \
2 # RUN: -verify-machineinstrs %s -o - | FileCheck %s
4 # Show that, when instructions that use the stack are present, it's possible
5 # for us to outline everything as the default outlining type.
6 # It's possible for reg-save-possible to outline by storing LR to a register,
7 # but most candidates in this case require us to modify the stack. The outliner
8 # should see that it's more beneficial to fix up instructions and save LR to
9 # the stack in this case.
12 define void @reg-save-possible() #0 { ret void }
13 define void @stack-save1() #0 { ret void }
14 define void @stack-save2() #0 { ret void }
15 define void @stack-save3() #0 { ret void }
16 attributes #0 = { minsize noinline noredzone "frame-pointer"="all" }
20 name: reg-save-possible
21 tracksRegLiveness: true
30 ; CHECK-LABEL: name: reg-save-possible
31 ; CHECK: $sp = STRXpre $lr, $sp, -16
32 ; CHECK-NEXT: BL [[FN:@OUTLINED_FUNCTION_[0-9]+]]
33 ; CHECK-NEXT: $sp, $lr = LDRXpost $sp, 16
34 $x20, $x19 = LDPXi $sp, 10
35 $x20, $x19 = LDPXi $sp, 10
36 $x20, $x19 = LDPXi $sp, 10
37 $x20, $x19 = LDPXi $sp, 10
38 $x20, $x19 = LDPXi $sp, 10
46 tracksRegLiveness: true
49 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
52 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
53 ; CHECK-LABEL: name: stack-save1
54 ; CHECK: $sp = STRXpre $lr, $sp, -16
55 ; CHECK-NEXT: BL [[FN]]
56 ; CHECK-NEXT: $sp, $lr = LDRXpost $sp, 16
57 $x20, $x19 = LDPXi $sp, 10
58 $x20, $x19 = LDPXi $sp, 10
59 $x20, $x19 = LDPXi $sp, 10
60 $x20, $x19 = LDPXi $sp, 10
61 $x20, $x19 = LDPXi $sp, 10
63 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
70 tracksRegLiveness: true
73 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
76 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
77 ; CHECK-LABEL: name: stack-save2
78 ; CHECK: $sp = STRXpre $lr, $sp, -16
79 ; CHECK-NEXT: BL [[FN]]
80 ; CHECK-NEXT: $sp, $lr = LDRXpost $sp, 16
81 $x20, $x19 = LDPXi $sp, 10
82 $x20, $x19 = LDPXi $sp, 10
83 $x20, $x19 = LDPXi $sp, 10
84 $x20, $x19 = LDPXi $sp, 10
85 $x20, $x19 = LDPXi $sp, 10
87 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
94 tracksRegLiveness: true
97 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
100 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
101 ; CHECK-LABEL: name: stack-save3
102 ; CHECK: $sp = STRXpre $lr, $sp, -16
103 ; CHECK-NEXT: BL [[FN]]
104 ; CHECK-NEXT: $sp, $lr = LDRXpost $sp, 16
105 $x20, $x19 = LDPXi $sp, 10
106 $x20, $x19 = LDPXi $sp, 10
107 $x20, $x19 = LDPXi $sp, 10
108 $x20, $x19 = LDPXi $sp, 10
109 $x20, $x19 = LDPXi $sp, 10
111 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp