1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -enable-patchpoint-liveness=false | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck -check-prefix=PATCH %s
4 ; Note: Print verbose stackmaps using -debug-only=stackmaps.
6 ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
7 ; CHECK-NEXT: __LLVM_StackMaps:
11 ; CHECK-NEXT: .short 0
19 ; Functions and stack size
20 ; CHECK-NEXT: .quad _stackmap_liveness
23 ; CHECK-NEXT: .quad _mixed_liveness
27 define void @stackmap_liveness() {
29 %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
30 ; StackMap 1 (no liveness information available)
31 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
32 ; CHECK-NEXT: .short 0
33 ; CHECK-NEXT: .short 0
35 ; CHECK-NEXT: .p2align 3
36 ; CHECK-NEXT: .short 0
37 ; Num LiveOut Entries: 0
38 ; CHECK-NEXT: .short 0
40 ; CHECK-NEXT: .p2align 3
42 ; StackMap 1 (patchpoint liveness information enabled)
43 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
44 ; PATCH-NEXT: .short 0
45 ; PATCH-NEXT: .short 0
47 ; PATCH-NEXT: .p2align 3
48 ; PATCH-NEXT: .short 0
49 ; Num LiveOut Entries: 6
50 ; PATCH-NEXT: .short 6
52 ; PATCH-NEXT: .short 3
56 ; PATCH-NEXT: .short 12
60 ; PATCH-NEXT: .short 13
64 ; PATCH-NEXT: .short 14
68 ; PATCH-NEXT: .short 15
71 ; LiveOut Entry 6: %ymm2 (16 bytes) --> %xmm2
72 ; PATCH-NEXT: .short 19
74 ; PATCH-NEXT: .byte 16
76 ; PATCH-NEXT: .p2align 3
77 call anyregcc void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 12, ptr null, i32 0)
78 %a2 = call i64 asm sideeffect "", "={r8}"() nounwind
79 %a3 = call i8 asm sideeffect "", "={ah}"() nounwind
80 %a4 = call <4 x double> asm sideeffect "", "={ymm0}"() nounwind
81 %a5 = call <4 x double> asm sideeffect "", "={ymm1}"() nounwind
83 ; StackMap 2 (no liveness information available)
84 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
85 ; CHECK-NEXT: .short 0
86 ; CHECK-NEXT: .short 0
88 ; CHECK-NEXT: .p2align 3
89 ; CHECK-NEXT: .short 0
90 ; Num LiveOut Entries: 0
91 ; CHECK-NEXT: .short 0
93 ; CHECK-NEXT: .p2align 3
95 ; StackMap 2 (patchpoint liveness information enabled)
96 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
97 ; PATCH-NEXT: .short 0
98 ; PATCH-NEXT: .short 0
100 ; PATCH-NEXT: .p2align 3
101 ; PATCH-NEXT: .short 0
102 ; Num LiveOut Entries: 10
103 ; PATCH-NEXT: .short 10
105 ; LiveOut Entry 1: %rax (1 bytes) --> %al or %ah
106 ; PATCH-NEXT: .short 0
107 ; PATCH-NEXT: .byte 0
108 ; PATCH-NEXT: .byte 1
110 ; PATCH-NEXT: .short 3
111 ; PATCH-NEXT: .byte 0
112 ; PATCH-NEXT: .byte 8
113 ; LiveOut Entry 3: %r8 (8 bytes)
114 ; PATCH-NEXT: .short 8
115 ; PATCH-NEXT: .byte 0
116 ; PATCH-NEXT: .byte 8
118 ; PATCH-NEXT: .short 12
119 ; PATCH-NEXT: .byte 0
120 ; PATCH-NEXT: .byte 8
122 ; PATCH-NEXT: .short 13
123 ; PATCH-NEXT: .byte 0
124 ; PATCH-NEXT: .byte 8
126 ; PATCH-NEXT: .short 14
127 ; PATCH-NEXT: .byte 0
128 ; PATCH-NEXT: .byte 8
130 ; PATCH-NEXT: .short 15
131 ; PATCH-NEXT: .byte 0
132 ; PATCH-NEXT: .byte 8
133 ; LiveOut Entry 8: %ymm0 (32 bytes)
134 ; PATCH-NEXT: .short 17
135 ; PATCH-NEXT: .byte 0
136 ; PATCH-NEXT: .byte 32
137 ; LiveOut Entry 9: %ymm1 (32 bytes)
138 ; PATCH-NEXT: .short 18
139 ; PATCH-NEXT: .byte 0
140 ; PATCH-NEXT: .byte 32
141 ; LiveOut Entry 10: %ymm2 (16 bytes) --> %xmm2
142 ; PATCH-NEXT: .short 19
143 ; PATCH-NEXT: .byte 0
144 ; PATCH-NEXT: .byte 16
146 ; PATCH-NEXT: .p2align 3
147 call anyregcc void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 2, i32 12, ptr null, i32 0)
148 call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind
150 ; StackMap 3 (no liveness information available)
151 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
152 ; CHECK-NEXT: .short 0
153 ; CHECK-NEXT: .short 0
155 ; CHECK-NEXT: .p2align 3
156 ; CHECK-NEXT: .short 0
157 ; Num LiveOut Entries: 0
158 ; CHECK-NEXT: .short 0
160 ; CHECK-NEXT: .p2align 3
162 ; StackMap 3 (patchpoint liveness information enabled)
163 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
164 ; PATCH-NEXT: .short 0
165 ; PATCH-NEXT: .short 0
167 ; PATCH-NEXT: .p2align 3
168 ; PATCH-NEXT: .short 0
169 ; Num LiveOut Entries: 7
170 ; PATCH-NEXT: .short 7
172 ; PATCH-NEXT: .short 3
173 ; PATCH-NEXT: .byte 0
174 ; PATCH-NEXT: .byte 8
175 ; LiveOut Entry 2: %rsp (8 bytes)
176 ; PATCH-NEXT: .short 7
177 ; PATCH-NEXT: .byte 0
178 ; PATCH-NEXT: .byte 8
180 ; PATCH-NEXT: .short 12
181 ; PATCH-NEXT: .byte 0
182 ; PATCH-NEXT: .byte 8
184 ; PATCH-NEXT: .short 13
185 ; PATCH-NEXT: .byte 0
186 ; PATCH-NEXT: .byte 8
188 ; PATCH-NEXT: .short 14
189 ; PATCH-NEXT: .byte 0
190 ; PATCH-NEXT: .byte 8
192 ; PATCH-NEXT: .short 15
193 ; PATCH-NEXT: .byte 0
194 ; PATCH-NEXT: .byte 8
195 ; LiveOut Entry 7: %ymm2 (16 bytes) --> %xmm2
196 ; PATCH-NEXT: .short 19
197 ; PATCH-NEXT: .byte 0
198 ; PATCH-NEXT: .byte 16
200 ; PATCH-NEXT: .p2align 3
201 call anyregcc void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 3, i32 12, ptr null, i32 0)
202 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
206 define void @mixed_liveness() {
208 %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
209 ; StackMap 4 (patchpoint liveness information enabled)
210 ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
211 ; PATCH-NEXT: .short 0
212 ; PATCH-NEXT: .short 0
214 ; PATCH-NEXT: .p2align 3
215 ; PATCH-NEXT: .short 0
216 ; Num LiveOut Entries: 0
217 ; PATCH-NEXT: .short 0
219 ; PATCH-NEXT: .p2align 3
221 ; StackMap 5 (patchpoint liveness information enabled)
222 ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
223 ; PATCH-NEXT: .short 0
224 ; PATCH-NEXT: .short 0
226 ; PATCH-NEXT: .p2align 3
227 ; PATCH-NEXT: .short 0
228 ; Num LiveOut Entries: 7
229 ; PATCH-NEXT: .short 7
231 ; PATCH-NEXT: .short 3
232 ; PATCH-NEXT: .byte 0
233 ; PATCH-NEXT: .byte 8
234 ; LiveOut Entry 2: %rsp (8 bytes)
235 ; PATCH-NEXT: .short 7
236 ; PATCH-NEXT: .byte 0
237 ; PATCH-NEXT: .byte 8
239 ; PATCH-NEXT: .short 12
240 ; PATCH-NEXT: .byte 0
241 ; PATCH-NEXT: .byte 8
243 ; PATCH-NEXT: .short 13
244 ; PATCH-NEXT: .byte 0
245 ; PATCH-NEXT: .byte 8
247 ; PATCH-NEXT: .short 14
248 ; PATCH-NEXT: .byte 0
249 ; PATCH-NEXT: .byte 8
251 ; PATCH-NEXT: .short 15
252 ; PATCH-NEXT: .byte 0
253 ; PATCH-NEXT: .byte 8
254 ; LiveOut Entry 7: %ymm2 (16 bytes) --> %xmm2
255 ; PATCH-NEXT: .short 19
256 ; PATCH-NEXT: .byte 0
257 ; PATCH-NEXT: .byte 16
259 ; PATCH-NEXT: .p2align 3
260 call void (i64, i32, ...) @llvm.experimental.stackmap(i64 4, i32 5)
261 call anyregcc void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 5, i32 0, ptr null, i32 0)
262 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
266 declare void @llvm.experimental.stackmap(i64, i32, ...)
267 declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)