1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | FileCheck %s --check-prefix=I386
3 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefix=X86-64
5 @result = dso_local global i32 0, align 4
7 define dso_local i32 @skip(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="skip" {
9 ; I386: # %bb.0: # %entry
10 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
14 ; X86-64: # %bb.0: # %entry
15 ; X86-64-NEXT: movl %edi, %eax
22 define dso_local i32 @used_gpr_arg(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="used-gpr-arg" {
23 ; I386-LABEL: used_gpr_arg:
24 ; I386: # %bb.0: # %entry
25 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
28 ; X86-64-LABEL: used_gpr_arg:
29 ; X86-64: # %bb.0: # %entry
30 ; X86-64-NEXT: movl %edi, %eax
31 ; X86-64-NEXT: xorl %edi, %edi
38 define dso_local i32 @used_gpr(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="used-gpr" {
39 ; I386-LABEL: used_gpr:
40 ; I386: # %bb.0: # %entry
41 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
44 ; X86-64-LABEL: used_gpr:
45 ; X86-64: # %bb.0: # %entry
46 ; X86-64-NEXT: movl %edi, %eax
47 ; X86-64-NEXT: xorl %edi, %edi
54 define dso_local i32 @used_arg(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="used-arg" {
55 ; I386-LABEL: used_arg:
56 ; I386: # %bb.0: # %entry
57 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
60 ; X86-64-LABEL: used_arg:
61 ; X86-64: # %bb.0: # %entry
62 ; X86-64-NEXT: movl %edi, %eax
63 ; X86-64-NEXT: xorl %edi, %edi
70 define dso_local i32 @used(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="used" {
72 ; I386: # %bb.0: # %entry
73 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
77 ; X86-64: # %bb.0: # %entry
78 ; X86-64-NEXT: movl %edi, %eax
79 ; X86-64-NEXT: xorl %edi, %edi
86 define dso_local i32 @all_gpr_arg(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="all-gpr-arg" {
87 ; I386-LABEL: all_gpr_arg:
88 ; I386: # %bb.0: # %entry
89 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
90 ; I386-NEXT: xorl %ecx, %ecx
91 ; I386-NEXT: xorl %edx, %edx
94 ; X86-64-LABEL: all_gpr_arg:
95 ; X86-64: # %bb.0: # %entry
96 ; X86-64-NEXT: movl %edi, %eax
97 ; X86-64-NEXT: xorl %ecx, %ecx
98 ; X86-64-NEXT: xorl %edi, %edi
99 ; X86-64-NEXT: xorl %edx, %edx
100 ; X86-64-NEXT: xorl %esi, %esi
101 ; X86-64-NEXT: xorl %r8d, %r8d
102 ; X86-64-NEXT: xorl %r9d, %r9d
109 define dso_local i32 @all_gpr(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="all-gpr" {
110 ; I386-LABEL: all_gpr:
111 ; I386: # %bb.0: # %entry
112 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
113 ; I386-NEXT: xorl %ecx, %ecx
114 ; I386-NEXT: xorl %edx, %edx
117 ; X86-64-LABEL: all_gpr:
118 ; X86-64: # %bb.0: # %entry
119 ; X86-64-NEXT: movl %edi, %eax
120 ; X86-64-NEXT: xorl %ecx, %ecx
121 ; X86-64-NEXT: xorl %edi, %edi
122 ; X86-64-NEXT: xorl %edx, %edx
123 ; X86-64-NEXT: xorl %esi, %esi
124 ; X86-64-NEXT: xorl %r8d, %r8d
125 ; X86-64-NEXT: xorl %r9d, %r9d
126 ; X86-64-NEXT: xorl %r10d, %r10d
127 ; X86-64-NEXT: xorl %r11d, %r11d
134 define dso_local i32 @all_arg(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="all-arg" {
135 ; I386-LABEL: all_arg:
136 ; I386: # %bb.0: # %entry
137 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
138 ; I386-NEXT: xorl %ecx, %ecx
139 ; I386-NEXT: xorl %edx, %edx
142 ; X86-64-LABEL: all_arg:
143 ; X86-64: # %bb.0: # %entry
144 ; X86-64-NEXT: movl %edi, %eax
145 ; X86-64-NEXT: xorl %ecx, %ecx
146 ; X86-64-NEXT: xorl %edi, %edi
147 ; X86-64-NEXT: xorl %edx, %edx
148 ; X86-64-NEXT: xorl %esi, %esi
149 ; X86-64-NEXT: xorl %r8d, %r8d
150 ; X86-64-NEXT: xorl %r9d, %r9d
151 ; X86-64-NEXT: xorps %xmm0, %xmm0
152 ; X86-64-NEXT: xorps %xmm1, %xmm1
153 ; X86-64-NEXT: xorps %xmm2, %xmm2
154 ; X86-64-NEXT: xorps %xmm3, %xmm3
155 ; X86-64-NEXT: xorps %xmm4, %xmm4
156 ; X86-64-NEXT: xorps %xmm5, %xmm5
157 ; X86-64-NEXT: xorps %xmm6, %xmm6
158 ; X86-64-NEXT: xorps %xmm7, %xmm7
165 define dso_local i32 @all(i32 returned %x) local_unnamed_addr #0 "zero-call-used-regs"="all" {
167 ; I386: # %bb.0: # %entry
168 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
176 ; I386-NEXT: fstp %st(0)
177 ; I386-NEXT: fstp %st(0)
178 ; I386-NEXT: fstp %st(0)
179 ; I386-NEXT: fstp %st(0)
180 ; I386-NEXT: fstp %st(0)
181 ; I386-NEXT: fstp %st(0)
182 ; I386-NEXT: fstp %st(0)
183 ; I386-NEXT: xorl %ecx, %ecx
184 ; I386-NEXT: xorl %edx, %edx
185 ; I386-NEXT: xorps %xmm0, %xmm0
186 ; I386-NEXT: xorps %xmm1, %xmm1
187 ; I386-NEXT: xorps %xmm2, %xmm2
188 ; I386-NEXT: xorps %xmm3, %xmm3
189 ; I386-NEXT: xorps %xmm4, %xmm4
190 ; I386-NEXT: xorps %xmm5, %xmm5
191 ; I386-NEXT: xorps %xmm6, %xmm6
192 ; I386-NEXT: xorps %xmm7, %xmm7
196 ; X86-64: # %bb.0: # %entry
197 ; X86-64-NEXT: movl %edi, %eax
206 ; X86-64-NEXT: fstp %st(0)
207 ; X86-64-NEXT: fstp %st(0)
208 ; X86-64-NEXT: fstp %st(0)
209 ; X86-64-NEXT: fstp %st(0)
210 ; X86-64-NEXT: fstp %st(0)
211 ; X86-64-NEXT: fstp %st(0)
212 ; X86-64-NEXT: fstp %st(0)
213 ; X86-64-NEXT: fstp %st(0)
214 ; X86-64-NEXT: xorl %ecx, %ecx
215 ; X86-64-NEXT: xorl %edi, %edi
216 ; X86-64-NEXT: xorl %edx, %edx
217 ; X86-64-NEXT: xorl %esi, %esi
218 ; X86-64-NEXT: xorl %r8d, %r8d
219 ; X86-64-NEXT: xorl %r9d, %r9d
220 ; X86-64-NEXT: xorl %r10d, %r10d
221 ; X86-64-NEXT: xorl %r11d, %r11d
222 ; X86-64-NEXT: xorps %xmm0, %xmm0
223 ; X86-64-NEXT: xorps %xmm1, %xmm1
224 ; X86-64-NEXT: xorps %xmm2, %xmm2
225 ; X86-64-NEXT: xorps %xmm3, %xmm3
226 ; X86-64-NEXT: xorps %xmm4, %xmm4
227 ; X86-64-NEXT: xorps %xmm5, %xmm5
228 ; X86-64-NEXT: xorps %xmm6, %xmm6
229 ; X86-64-NEXT: xorps %xmm7, %xmm7
230 ; X86-64-NEXT: xorps %xmm8, %xmm8
231 ; X86-64-NEXT: xorps %xmm9, %xmm9
232 ; X86-64-NEXT: xorps %xmm10, %xmm10
233 ; X86-64-NEXT: xorps %xmm11, %xmm11
234 ; X86-64-NEXT: xorps %xmm12, %xmm12
235 ; X86-64-NEXT: xorps %xmm13, %xmm13
236 ; X86-64-NEXT: xorps %xmm14, %xmm14
237 ; X86-64-NEXT: xorps %xmm15, %xmm15
244 define dso_local void @tailcall(ptr %p) local_unnamed_addr #0 "zero-call-used-regs"="used-gpr" {
245 ; I386-LABEL: tailcall:
247 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
248 ; I386-NEXT: jmpl *(%eax) # TAILCALL
250 ; X86-64-LABEL: tailcall:
252 ; X86-64-NEXT: jmpq *(%rdi) # TAILCALL
253 %c = load ptr, ptr %p
258 ; Don't emit zeroing registers in "main" function.
259 define dso_local i32 @main() local_unnamed_addr #1 {
261 ; I386: # %bb.0: # %entry
262 ; I386-NEXT: xorl %eax, %eax
265 ; X86-64-LABEL: main:
266 ; X86-64: # %bb.0: # %entry
267 ; X86-64-NEXT: xorl %eax, %eax
274 attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
275 attributes #1 = { nofree norecurse nounwind uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }