1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim -enable-stackmap-liveness| FileCheck -check-prefix=STACK %s
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim -enable-patchpoint-liveness| FileCheck -check-prefix=PATCH %s
5 ; Note: Print verbose stackmaps using -debug-only=stackmaps.
7 ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
8 ; CHECK-NEXT: __LLVM_StackMaps:
12 ; CHECK-NEXT: .short 0
20 ; Functions and stack size
21 ; CHECK-NEXT: .quad _stackmap_liveness
23 ; CHECK-NEXT: .quad _mixed_liveness
26 define void @stackmap_liveness() {
28 %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
29 ; StackMap 1 (no liveness information available)
30 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
31 ; CHECK-NEXT: .short 0
32 ; CHECK-NEXT: .short 0
34 ; CHECK-NEXT: .short 0
35 ; Num LiveOut Entries: 0
36 ; CHECK-NEXT: .short 0
38 ; CHECK-NEXT: .align 3
40 ; StackMap 1 (stackmap liveness information enabled)
41 ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
42 ; STACK-NEXT: .short 0
43 ; STACK-NEXT: .short 0
45 ; STACK-NEXT: .short 0
46 ; Num LiveOut Entries: 2
47 ; STACK-NEXT: .short 2
48 ; LiveOut Entry 1: %RSP (8 bytes)
49 ; STACK-NEXT: .short 7
52 ; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
53 ; STACK-NEXT: .short 19
55 ; STACK-NEXT: .byte 16
57 ; STACK-NEXT: .align 3
59 ; StackMap 1 (patchpoint liveness information enabled)
60 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
61 ; PATCH-NEXT: .short 0
62 ; PATCH-NEXT: .short 0
64 ; PATCH-NEXT: .short 0
65 ; Num LiveOut Entries: 0
66 ; PATCH-NEXT: .short 0
68 ; PATCH-NEXT: .align 3
69 call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 5)
70 %a2 = call i64 asm sideeffect "", "={r8}"() nounwind
71 %a3 = call i8 asm sideeffect "", "={ah}"() nounwind
72 %a4 = call <4 x double> asm sideeffect "", "={ymm0}"() nounwind
73 %a5 = call <4 x double> asm sideeffect "", "={ymm1}"() nounwind
75 ; StackMap 2 (no liveness information available)
76 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
77 ; CHECK-NEXT: .short 0
78 ; CHECK-NEXT: .short 0
80 ; CHECK-NEXT: .short 0
81 ; Num LiveOut Entries: 0
82 ; CHECK-NEXT: .short 0
84 ; CHECK-NEXT: .align 3
86 ; StackMap 2 (stackmap liveness information enabled)
87 ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
88 ; STACK-NEXT: .short 0
89 ; STACK-NEXT: .short 0
91 ; STACK-NEXT: .short 0
92 ; Num LiveOut Entries: 6
93 ; STACK-NEXT: .short 6
94 ; LiveOut Entry 1: %RAX (1 bytes) --> %AL or %AH
95 ; STACK-NEXT: .short 0
98 ; LiveOut Entry 2: %RSP (8 bytes)
99 ; STACK-NEXT: .short 7
100 ; STACK-NEXT: .byte 0
101 ; STACK-NEXT: .byte 8
102 ; LiveOut Entry 3: %R8 (8 bytes)
103 ; STACK-NEXT: .short 8
104 ; STACK-NEXT: .byte 0
105 ; STACK-NEXT: .byte 8
106 ; LiveOut Entry 4: %YMM0 (32 bytes)
107 ; STACK-NEXT: .short 17
108 ; STACK-NEXT: .byte 0
109 ; STACK-NEXT: .byte 32
110 ; LiveOut Entry 5: %YMM1 (32 bytes)
111 ; STACK-NEXT: .short 18
112 ; STACK-NEXT: .byte 0
113 ; STACK-NEXT: .byte 32
114 ; LiveOut Entry 6: %YMM2 (16 bytes) --> %XMM2
115 ; STACK-NEXT: .short 19
116 ; STACK-NEXT: .byte 0
117 ; STACK-NEXT: .byte 16
119 ; STACK-NEXT: .align 3
121 ; StackMap 2 (patchpoint liveness information enabled)
122 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
123 ; PATCH-NEXT: .short 0
124 ; PATCH-NEXT: .short 0
126 ; PATCH-NEXT: .short 0
127 ; Num LiveOut Entries: 0
128 ; PATCH-NEXT: .short 0
130 ; PATCH-NEXT: .align 3
131 call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 2, i32 5)
132 call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind
134 ; StackMap 3 (no liveness information available)
135 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
136 ; CHECK-NEXT: .short 0
137 ; CHECK-NEXT: .short 0
139 ; CHECK-NEXT: .short 0
140 ; Num LiveOut Entries: 0
141 ; CHECK-NEXT: .short 0
143 ; CHECK-NEXT: .align 3
145 ; StackMap 3 (stackmap liveness information enabled)
146 ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
147 ; STACK-NEXT: .short 0
148 ; STACK-NEXT: .short 0
150 ; STACK-NEXT: .short 0
151 ; Num LiveOut Entries: 2
152 ; STACK-NEXT: .short 2
153 ; LiveOut Entry 1: %RSP (8 bytes)
154 ; STACK-NEXT: .short 7
155 ; STACK-NEXT: .byte 0
156 ; STACK-NEXT: .byte 8
157 ; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
158 ; STACK-NEXT: .short 19
159 ; STACK-NEXT: .byte 0
160 ; STACK-NEXT: .byte 16
162 ; STACK-NEXT: .align 3
164 ; StackMap 3 (patchpoint liveness information enabled)
165 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
166 ; PATCH-NEXT: .short 0
167 ; PATCH-NEXT: .short 0
169 ; PATCH-NEXT: .short 0
170 ; Num LiveOut Entries: 0
171 ; PATCH-NEXT: .short 0
173 ; PATCH-NEXT: .align 3
174 call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 5)
175 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
179 define void @mixed_liveness() {
181 %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
182 ; StackMap 4 (stackmap liveness information enabled)
183 ; STACK-LABEL: .long L{{.*}}-_mixed_liveness
184 ; STACK-NEXT: .short 0
185 ; STACK-NEXT: .short 0
187 ; STACK-NEXT: .short 0
188 ; Num LiveOut Entries: 1
189 ; STACK-NEXT: .short 1
190 ; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
191 ; STACK-NEXT: .short 19
192 ; STACK-NEXT: .byte 0
193 ; STACK-NEXT: .byte 16
195 ; STACK-NEXT: .align 3
198 ; StackMap 5 (stackmap liveness information enabled)
199 ; STACK-LABEL: .long L{{.*}}-_mixed_liveness
200 ; STACK-NEXT: .short 0
201 ; STACK-NEXT: .short 0
203 ; STACK-NEXT: .short 0
204 ; Num LiveOut Entries: 0
205 ; STACK-NEXT: .short 0
207 ; STACK-NEXT: .align 3
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: .short 0
215 ; Num LiveOut Entries: 0
216 ; PATCH-NEXT: .short 0
218 ; PATCH-NEXT: .align 3
220 ; StackMap 5 (patchpoint liveness information enabled)
221 ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
222 ; PATCH-NEXT: .short 0
223 ; PATCH-NEXT: .short 0
225 ; PATCH-NEXT: .short 0
226 ; Num LiveOut Entries: 2
227 ; PATCH-NEXT: .short 2
228 ; LiveOut Entry 1: %RSP (8 bytes)
229 ; PATCH-NEXT: .short 7
230 ; PATCH-NEXT: .byte 0
231 ; PATCH-NEXT: .byte 8
232 ; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
233 ; PATCH-NEXT: .short 19
234 ; PATCH-NEXT: .byte 0
235 ; PATCH-NEXT: .byte 16
237 ; PATCH-NEXT: .align 3
238 call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 4, i32 5)
239 call anyregcc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 5, i32 0, i8* null, i32 0)
240 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
244 declare void @llvm.experimental.stackmap(i64, i32, ...)
245 declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...)