1 # RUN: llc -mtriple=aarch64-arm-none-eabi -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() #0 {
16 attributes #0 = { nounwind "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" minsize noinline noredzone "frame-pointer"="all" }
19 # CHECK-LABEL: name: foo
21 # CHECK: frame-setup EMITBKEY
22 # CHECK-NEXT: frame-setup PACIBSP
23 # CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
25 # CHECK: BL @[[OUTLINED_FUNCTION:OUTLINED_FUNCTION_[0-9]+]]
27 # CHECK: BL @[[OUTLINED_FUNCTION]]
29 # CHECK: BL @[[OUTLINED_FUNCTION]]
31 # CHECK: BL @[[OUTLINED_FUNCTION]]
33 # CHECK: frame-destroy AUTIBSP
36 tracksRegLiveness: true
82 # CHECK-NOT: OUTLINED_FUNCTION_
84 # CHECK-NOT: OUTLINED_FUNCTION_
86 # CHECK-NOT: OUTLINED_FUNCTION_
88 # CHECK-NOT: OUTLINED_FUNCTION_
91 tracksRegLiveness: true
94 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 $w12 = ORRWri $wzr, 2
102 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
103 $w10 = ORRWri $wzr, 1
104 $w10 = ORRWri $wzr, 1
105 $w10 = ORRWri $wzr, 1
106 $w10 = ORRWri $wzr, 1
107 $w10 = ORRWri $wzr, 1
108 $w12 = ORRWri $wzr, 2
110 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
111 $w10 = ORRWri $wzr, 1
112 $w10 = ORRWri $wzr, 1
113 $w10 = ORRWri $wzr, 1
114 $w10 = ORRWri $wzr, 1
115 $w10 = ORRWri $wzr, 1
116 $w12 = ORRWri $wzr, 2
118 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
121 # CHECK: name: [[OUTLINED_FUNCTION]]
124 # CHECK-NOT: frame-setup EMITBKEY
125 # CHECK-NOT: frame-setup PACI{{[A,B]]}}SP
126 # CHECK-NOT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
127 # CHECK-NOT: frame-destroy AUTI{{[A,B]]}}SP