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: 1
50 ; PATCH-NEXT: .short 1
51 ; LiveOut Entry 1: %ymm2 (16 bytes) --> %xmm2
52 ; PATCH-NEXT: .short 19
54 ; PATCH-NEXT: .byte 16
56 ; PATCH-NEXT: .p2align 3
57 call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 12, i8* null, i32 0)
58 %a2 = call i64 asm sideeffect "", "={r8}"() nounwind
59 %a3 = call i8 asm sideeffect "", "={ah}"() nounwind
60 %a4 = call <4 x double> asm sideeffect "", "={ymm0}"() nounwind
61 %a5 = call <4 x double> asm sideeffect "", "={ymm1}"() nounwind
63 ; StackMap 2 (no liveness information available)
64 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
65 ; CHECK-NEXT: .short 0
66 ; CHECK-NEXT: .short 0
68 ; CHECK-NEXT: .p2align 3
69 ; CHECK-NEXT: .short 0
70 ; Num LiveOut Entries: 0
71 ; CHECK-NEXT: .short 0
73 ; CHECK-NEXT: .p2align 3
75 ; StackMap 2 (patchpoint liveness information enabled)
76 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
77 ; PATCH-NEXT: .short 0
78 ; PATCH-NEXT: .short 0
80 ; PATCH-NEXT: .p2align 3
81 ; PATCH-NEXT: .short 0
82 ; Num LiveOut Entries: 5
83 ; PATCH-NEXT: .short 5
84 ; LiveOut Entry 1: %rax (1 bytes) --> %al or %ah
85 ; PATCH-NEXT: .short 0
88 ; LiveOut Entry 2: %r8 (8 bytes)
89 ; PATCH-NEXT: .short 8
92 ; LiveOut Entry 3: %ymm0 (32 bytes)
93 ; PATCH-NEXT: .short 17
95 ; PATCH-NEXT: .byte 32
96 ; LiveOut Entry 4: %ymm1 (32 bytes)
97 ; PATCH-NEXT: .short 18
99 ; PATCH-NEXT: .byte 32
100 ; LiveOut Entry 5: %ymm2 (16 bytes) --> %xmm2
101 ; PATCH-NEXT: .short 19
102 ; PATCH-NEXT: .byte 0
103 ; PATCH-NEXT: .byte 16
105 ; PATCH-NEXT: .p2align 3
106 call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 2, i32 12, i8* null, i32 0)
107 call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind
109 ; StackMap 3 (no liveness information available)
110 ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
111 ; CHECK-NEXT: .short 0
112 ; CHECK-NEXT: .short 0
114 ; CHECK-NEXT: .p2align 3
115 ; CHECK-NEXT: .short 0
116 ; Num LiveOut Entries: 0
117 ; CHECK-NEXT: .short 0
119 ; CHECK-NEXT: .p2align 3
121 ; StackMap 3 (patchpoint liveness information enabled)
122 ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
123 ; PATCH-NEXT: .short 0
124 ; PATCH-NEXT: .short 0
126 ; PATCH-NEXT: .p2align 3
127 ; PATCH-NEXT: .short 0
128 ; Num LiveOut Entries: 2
129 ; PATCH-NEXT: .short 2
130 ; LiveOut Entry 1: %rsp (8 bytes)
131 ; PATCH-NEXT: .short 7
132 ; PATCH-NEXT: .byte 0
133 ; PATCH-NEXT: .byte 8
134 ; LiveOut Entry 2: %ymm2 (16 bytes) --> %xmm2
135 ; PATCH-NEXT: .short 19
136 ; PATCH-NEXT: .byte 0
137 ; PATCH-NEXT: .byte 16
139 ; PATCH-NEXT: .p2align 3
140 call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 3, i32 12, i8* null, i32 0)
141 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
145 define void @mixed_liveness() {
147 %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
148 ; StackMap 4 (patchpoint liveness information enabled)
149 ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
150 ; PATCH-NEXT: .short 0
151 ; PATCH-NEXT: .short 0
153 ; PATCH-NEXT: .p2align 3
154 ; PATCH-NEXT: .short 0
155 ; Num LiveOut Entries: 0
156 ; PATCH-NEXT: .short 0
158 ; PATCH-NEXT: .p2align 3
160 ; StackMap 5 (patchpoint liveness information enabled)
161 ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
162 ; PATCH-NEXT: .short 0
163 ; PATCH-NEXT: .short 0
165 ; PATCH-NEXT: .p2align 3
166 ; PATCH-NEXT: .short 0
167 ; Num LiveOut Entries: 2
168 ; PATCH-NEXT: .short 2
169 ; LiveOut Entry 1: %rsp (8 bytes)
170 ; PATCH-NEXT: .short 7
171 ; PATCH-NEXT: .byte 0
172 ; PATCH-NEXT: .byte 8
173 ; LiveOut Entry 2: %ymm2 (16 bytes) --> %xmm2
174 ; PATCH-NEXT: .short 19
175 ; PATCH-NEXT: .byte 0
176 ; PATCH-NEXT: .byte 16
178 ; PATCH-NEXT: .p2align 3
179 call void (i64, i32, ...) @llvm.experimental.stackmap(i64 4, i32 5)
180 call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 5, i32 0, i8* null, i32 0)
181 call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
185 declare void @llvm.experimental.stackmap(i64, i32, ...)
186 declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...)