1 # RUN: llc -mtriple=aarch64 -run-pass=prologepilog \
2 # RUN: -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
4 # Check that we save LR to a callee-saved register when possible.
5 # foo() should use a callee-saved register. However, bar() should not.
8 define void @foo() #0 {
12 define void @bar() #1 {
16 attributes #0 = { nounwind "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" minsize noinline noredzone "frame-pointer"="all" }
17 attributes #1 = { nounwind uwtable "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" minsize noinline noredzone "frame-pointer"="all" }
20 # CHECK-LABEL: name: foo
22 # CHECK: frame-setup EMITBKEY
23 # CHECK-NEXT: frame-setup PACIBSP
24 # CHECK-NOT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
26 # CHECK: BL @[[OUTLINED_FUNCTION:OUTLINED_FUNCTION_[0-9]+]]
28 # CHECK: BL @[[OUTLINED_FUNCTION]]
30 # CHECK: BL @[[OUTLINED_FUNCTION]]
32 # CHECK: BL @[[OUTLINED_FUNCTION]]
34 # CHECK: frame-destroy AUTIBSP
37 tracksRegLiveness: true
83 # CHECK: frame-setup EMITBKEY
84 # CHECK-NEXT: frame-setup PACIBSP implicit-def $lr, implicit $lr, implicit $sp
85 # CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
86 # CHECK-NOT: OUTLINED_FUNCTION_
88 # CHECK-NOT: OUTLINED_FUNCTION_
90 # CHECK-NOT: OUTLINED_FUNCTION_
92 # CHECK-NOT: OUTLINED_FUNCTION_
95 tracksRegLiveness: true
98 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
100 $w10 = ORRWri $wzr, 1
101 $w10 = ORRWri $wzr, 1
102 $w10 = ORRWri $wzr, 1
103 $w10 = ORRWri $wzr, 1
104 $w12 = ORRWri $wzr, 2
106 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
107 $w10 = ORRWri $wzr, 1
108 $w10 = ORRWri $wzr, 1
109 $w10 = ORRWri $wzr, 1
110 $w10 = ORRWri $wzr, 1
111 $w10 = ORRWri $wzr, 1
112 $w12 = ORRWri $wzr, 2
114 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
115 $w10 = ORRWri $wzr, 1
116 $w10 = ORRWri $wzr, 1
117 $w10 = ORRWri $wzr, 1
118 $w10 = ORRWri $wzr, 1
119 $w10 = ORRWri $wzr, 1
120 $w12 = ORRWri $wzr, 2
122 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
125 # CHECK: name: [[OUTLINED_FUNCTION]]
128 # CHECK-NOT: frame-setup EMITBKEY
129 # CHECK-NOT: frame-setup PACI{{[A,B]]}}SP
130 # CHECK-NOT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
131 # CHECK-NOT: frame-destroy AUTI{{[A,B]]}}SP