1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=i686-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=CHECK32
3 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=CHECK64
5 define void @zero_optsize(ptr %p) optsize {
6 ; CHECK32-LABEL: zero_optsize:
7 ; CHECK32: # %bb.0: # %entry
8 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
9 ; CHECK32-NEXT: movl $0, (%eax)
12 ; CHECK64-LABEL: zero_optsize:
13 ; CHECK64: # %bb.0: # %entry
14 ; CHECK64-NEXT: movl $0, (%rdi)
22 define void @zero_pgso(ptr %p) !prof !14 {
23 ; CHECK32-LABEL: zero_pgso:
24 ; CHECK32: # %bb.0: # %entry
25 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
26 ; CHECK32-NEXT: movl $0, (%eax)
29 ; CHECK64-LABEL: zero_pgso:
30 ; CHECK64: # %bb.0: # %entry
31 ; CHECK64-NEXT: movl $0, (%rdi)
39 define void @minus_one_optsize(ptr %p) optsize {
40 ; CHECK32-LABEL: minus_one_optsize:
41 ; CHECK32: # %bb.0: # %entry
42 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
43 ; CHECK32-NEXT: movl $-1, (%eax)
46 ; CHECK64-LABEL: minus_one_optsize:
47 ; CHECK64: # %bb.0: # %entry
48 ; CHECK64-NEXT: movl $-1, (%rdi)
56 define void @minus_one_pgso(ptr %p) !prof !14 {
57 ; CHECK32-LABEL: minus_one_pgso:
58 ; CHECK32: # %bb.0: # %entry
59 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
60 ; CHECK32-NEXT: movl $-1, (%eax)
63 ; CHECK64-LABEL: minus_one_pgso:
64 ; CHECK64: # %bb.0: # %entry
65 ; CHECK64-NEXT: movl $-1, (%rdi)
73 define void @zero_64(ptr %p) minsize {
74 ; CHECK32-LABEL: zero_64:
75 ; CHECK32: # %bb.0: # %entry
76 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
77 ; CHECK32-NEXT: andl $0, 4(%eax)
78 ; CHECK32-NEXT: andl $0, (%eax)
81 ; CHECK64-LABEL: zero_64:
82 ; CHECK64: # %bb.0: # %entry
83 ; CHECK64-NEXT: andq $0, (%rdi)
91 define void @zero_32(ptr %p) minsize {
92 ; CHECK32-LABEL: zero_32:
93 ; CHECK32: # %bb.0: # %entry
94 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
95 ; CHECK32-NEXT: andl $0, (%eax)
98 ; CHECK64-LABEL: zero_32:
99 ; CHECK64: # %bb.0: # %entry
100 ; CHECK64-NEXT: andl $0, (%rdi)
108 define void @zero_16(ptr %p) minsize {
109 ; CHECK32-LABEL: zero_16:
110 ; CHECK32: # %bb.0: # %entry
111 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
112 ; CHECK32-NEXT: andw $0, (%eax)
115 ; CHECK64-LABEL: zero_16:
116 ; CHECK64: # %bb.0: # %entry
117 ; CHECK64-NEXT: andw $0, (%rdi)
126 define void @minus_one_64(ptr %p) minsize {
127 ; CHECK32-LABEL: minus_one_64:
128 ; CHECK32: # %bb.0: # %entry
129 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
130 ; CHECK32-NEXT: orl $-1, 4(%eax)
131 ; CHECK32-NEXT: orl $-1, (%eax)
134 ; CHECK64-LABEL: minus_one_64:
135 ; CHECK64: # %bb.0: # %entry
136 ; CHECK64-NEXT: orq $-1, (%rdi)
144 define void @minus_one_32(ptr %p) minsize {
145 ; CHECK32-LABEL: minus_one_32:
146 ; CHECK32: # %bb.0: # %entry
147 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
148 ; CHECK32-NEXT: orl $-1, (%eax)
151 ; CHECK64-LABEL: minus_one_32:
152 ; CHECK64: # %bb.0: # %entry
153 ; CHECK64-NEXT: orl $-1, (%rdi)
161 define void @minus_one_16(ptr %p) minsize {
162 ; CHECK32-LABEL: minus_one_16:
163 ; CHECK32: # %bb.0: # %entry
164 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
165 ; CHECK32-NEXT: orw $-1, (%eax)
168 ; CHECK64-LABEL: minus_one_16:
169 ; CHECK64: # %bb.0: # %entry
170 ; CHECK64-NEXT: orw $-1, (%rdi)
178 ; FIXME: Make sure we don't use the and/or trick on volatile stores.
179 define void @volatile_zero_64(ptr %p) minsize {
180 ; CHECK32-LABEL: volatile_zero_64:
181 ; CHECK32: # %bb.0: # %entry
182 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
183 ; CHECK32-NEXT: xorl %ecx, %ecx
184 ; CHECK32-NEXT: movl %ecx, 4(%eax)
185 ; CHECK32-NEXT: movl %ecx, (%eax)
188 ; CHECK64-LABEL: volatile_zero_64:
189 ; CHECK64: # %bb.0: # %entry
190 ; CHECK64-NEXT: movq $0, (%rdi)
193 store volatile i64 0, ptr %p
197 define void @volatile_zero_32(ptr %p) minsize {
198 ; CHECK32-LABEL: volatile_zero_32:
199 ; CHECK32: # %bb.0: # %entry
200 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
201 ; CHECK32-NEXT: movl $0, (%eax)
204 ; CHECK64-LABEL: volatile_zero_32:
205 ; CHECK64: # %bb.0: # %entry
206 ; CHECK64-NEXT: movl $0, (%rdi)
209 store volatile i32 0, ptr %p
213 define void @volatile_zero_16(ptr %p) minsize {
214 ; CHECK32-LABEL: volatile_zero_16:
215 ; CHECK32: # %bb.0: # %entry
216 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
217 ; CHECK32-NEXT: movw $0, (%eax)
220 ; CHECK64-LABEL: volatile_zero_16:
221 ; CHECK64: # %bb.0: # %entry
222 ; CHECK64-NEXT: movw $0, (%rdi)
225 store volatile i16 0, ptr %p
230 define void @volatile_minus_one_64(ptr %p) minsize {
231 ; CHECK32-LABEL: volatile_minus_one_64:
232 ; CHECK32: # %bb.0: # %entry
233 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
234 ; CHECK32-NEXT: xorl %ecx, %ecx
235 ; CHECK32-NEXT: decl %ecx
236 ; CHECK32-NEXT: movl %ecx, 4(%eax)
237 ; CHECK32-NEXT: movl %ecx, (%eax)
240 ; CHECK64-LABEL: volatile_minus_one_64:
241 ; CHECK64: # %bb.0: # %entry
242 ; CHECK64-NEXT: movq $-1, (%rdi)
245 store volatile i64 -1, ptr %p
249 define void @volatile_minus_one_32(ptr %p) minsize {
250 ; CHECK32-LABEL: volatile_minus_one_32:
251 ; CHECK32: # %bb.0: # %entry
252 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
253 ; CHECK32-NEXT: movl $-1, (%eax)
256 ; CHECK64-LABEL: volatile_minus_one_32:
257 ; CHECK64: # %bb.0: # %entry
258 ; CHECK64-NEXT: movl $-1, (%rdi)
261 store volatile i32 -1, ptr %p
265 define void @volatile_minus_one_16(ptr %p) minsize {
266 ; CHECK32-LABEL: volatile_minus_one_16:
267 ; CHECK32: # %bb.0: # %entry
268 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %eax
269 ; CHECK32-NEXT: movw $-1, (%eax)
272 ; CHECK64-LABEL: volatile_minus_one_16:
273 ; CHECK64: # %bb.0: # %entry
274 ; CHECK64-NEXT: movw $-1, (%rdi)
277 store volatile i16 -1, ptr %p
281 !llvm.module.flags = !{!0}
282 !0 = !{i32 1, !"ProfileSummary", !1}
283 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
284 !2 = !{!"ProfileFormat", !"InstrProf"}
285 !3 = !{!"TotalCount", i64 10000}
286 !4 = !{!"MaxCount", i64 10}
287 !5 = !{!"MaxInternalCount", i64 1}
288 !6 = !{!"MaxFunctionCount", i64 1000}
289 !7 = !{!"NumCounts", i64 3}
290 !8 = !{!"NumFunctions", i64 3}
291 !9 = !{!"DetailedSummary", !10}
292 !10 = !{!11, !12, !13}
293 !11 = !{i32 10000, i64 100, i32 1}
294 !12 = !{i32 999000, i64 100, i32 1}
295 !13 = !{i32 999999, i64 1, i32 2}
296 !14 = !{!"function_entry_count", i64 0}