1 # RUN: llc -mtriple=aarch64 -run-pass=prologepilog -run-pass=machine-outliner \
2 # RUN: -verify-machineinstrs -run-pass=aarch64-ptrauth %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: frame-setup CFI_INSTRUCTION negate_ra_sign_state
86 # CHECK-NEXT: frame-setup CFI_INSTRUCTION
87 # CHECK-NOT: OUTLINED_FUNCTION_
89 # CHECK-NOT: OUTLINED_FUNCTION_
91 # CHECK-NOT: OUTLINED_FUNCTION_
93 # CHECK-NOT: OUTLINED_FUNCTION_
96 tracksRegLiveness: true
99 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 $w10 = ORRWri $wzr, 1
105 $w12 = ORRWri $wzr, 2
107 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
108 $w10 = ORRWri $wzr, 1
109 $w10 = ORRWri $wzr, 1
110 $w10 = ORRWri $wzr, 1
111 $w10 = ORRWri $wzr, 1
112 $w10 = ORRWri $wzr, 1
113 $w12 = ORRWri $wzr, 2
115 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
116 $w10 = ORRWri $wzr, 1
117 $w10 = ORRWri $wzr, 1
118 $w10 = ORRWri $wzr, 1
119 $w10 = ORRWri $wzr, 1
120 $w10 = ORRWri $wzr, 1
121 $w12 = ORRWri $wzr, 2
123 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
126 # CHECK: name: [[OUTLINED_FUNCTION]]
129 # CHECK-NOT: frame-setup EMITBKEY
130 # CHECK-NOT: frame-setup PACI{{[A,B]}}SP
131 # CHECK-NOT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
132 # CHECK-NOT: frame-destroy AUTI{{[A,B]}}SP