1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-apple-unknown -run-pass=machine-outliner -verify-machineinstrs -enable-machine-outliner=always %s -o - | FileCheck %s
4 # Outlining CFI instructions is unsafe if it is not tail called, but otherwise,
5 # it requires fixups. Show that we don't include CFI instructions in non
6 # tail call outlined sequences right now. Show that we count CFI instructions
7 # correctly in the presence of debug info.
10 define void @foo() #0 { ret void }
11 define void @bar() #0 { ret void }
12 define void @baz() #0 { ret void }
13 attributes #0 = { noredzone }
18 tracksRegLiveness: true
22 ; CHECK-LABEL: name: foo
25 ; CHECK-NEXT: $w9 = ORRWri $wzr, 1
26 ; CHECK-NEXT: $w10 = ORRWri $wzr, 2
27 ; CHECK-NEXT: $w11 = ORRWri $wzr, 3
28 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
29 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
30 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
31 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
32 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
33 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
34 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $w29, 16
35 ; CHECK-NEXT: $w20 = ORRWri $wzr, 1
36 ; CHECK-NEXT: TCRETURNdi @OUTLINED_FUNCTION_0, 0, implicit $sp, implicit-def $w12, implicit-def $w13, implicit-def $w14, implicit-def $w15, implicit $wzr, implicit $sp
46 frame-setup CFI_INSTRUCTION def_cfa $w29, 16
56 tracksRegLiveness: true
60 ; CHECK-LABEL: name: bar
63 ; CHECK-NEXT: $w9 = ORRWri $wzr, 1
64 ; CHECK-NEXT: $w10 = ORRWri $wzr, 2
65 ; CHECK-NEXT: $w11 = ORRWri $wzr, 3
66 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
67 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
68 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
69 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
70 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
71 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
72 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $w29, 16
73 ; CHECK-NEXT: $w21 = ORRWri $wzr, 1
74 ; CHECK-NEXT: TCRETURNdi @OUTLINED_FUNCTION_0, 0, implicit $sp, implicit-def $w12, implicit-def $w13, implicit-def $w14, implicit-def $w15, implicit $wzr, implicit $sp
84 frame-setup CFI_INSTRUCTION def_cfa $w29, 16
94 tracksRegLiveness: true
98 ; CHECK-LABEL: name: baz
101 ; CHECK-NEXT: $w9 = ORRWri $wzr, 1
102 ; CHECK-NEXT: $w10 = ORRWri $wzr, 2
103 ; CHECK-NEXT: $w11 = ORRWri $wzr, 3
104 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
105 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
106 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
107 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
108 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
109 ; CHECK-NEXT: DBG_VALUE $w9, $noreg
110 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $w29, 16
111 ; CHECK-NEXT: $w22 = ORRWri $wzr, 1
112 ; CHECK-NEXT: TCRETURNdi @OUTLINED_FUNCTION_0, 0, implicit $sp, implicit-def $w12, implicit-def $w13, implicit-def $w14, implicit-def $w15, implicit $wzr, implicit $sp
114 $w10 = ORRWri $wzr, 2
115 $w11 = ORRWri $wzr, 3
116 DBG_VALUE $w9, $noreg
117 DBG_VALUE $w9, $noreg
118 DBG_VALUE $w9, $noreg
119 DBG_VALUE $w9, $noreg
120 DBG_VALUE $w9, $noreg
121 DBG_VALUE $w9, $noreg
122 frame-setup CFI_INSTRUCTION def_cfa $w29, 16
123 $w22 = ORRWri $wzr, 1
124 $w12 = ORRWri $wzr, 1
125 $w13 = ORRWri $wzr, 2
126 $w14 = ORRWri $wzr, 3
127 $w15 = ORRWri $wzr, 4