1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefixes=X86
3 ; RUN: llc < %s -mtriple=i686-unknown -mul-constant-optimization=false | FileCheck %s --check-prefixes=X86-NOOPT
4 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=haswell | FileCheck %s --check-prefixes=X64,X64-OPT,X64-HSW
5 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=btver2 | FileCheck %s --check-prefixes=X64,X64-OPT,X64-JAG
6 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=slm | FileCheck %s --check-prefixes=X64,X64-OPT,X64-SLM
7 ; RUN: llc < %s -mtriple=x86_64-unknown -mul-constant-optimization=false -mcpu=haswell | FileCheck %s --check-prefixes=X64,X64-NOOPT,X64-HSW-NOOPT
8 ; RUN: llc < %s -mtriple=x86_64-unknown -mul-constant-optimization=false -mcpu=btver2 | FileCheck %s --check-prefixes=X64,X64-NOOPT,X64-JAG-NOOPT
9 ; RUN: llc < %s -mtriple=x86_64-unknown -mul-constant-optimization=false -mcpu=slm | FileCheck %s --check-prefixes=X64,X64-NOOPT,X64-SLM-NOOPT
11 define i64 @test_mul_by_1(i64 %x) nounwind {
12 ; X86-LABEL: test_mul_by_1:
14 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
15 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
18 ; X86-NOOPT-LABEL: test_mul_by_1:
20 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
21 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
22 ; X86-NOOPT-NEXT: retl
24 ; X64-LABEL: test_mul_by_1:
26 ; X64-NEXT: movq %rdi, %rax
28 %mul = mul nsw i64 %x, 1
32 define i64 @test_mul_by_2(i64 %x) {
33 ; X86-LABEL: test_mul_by_2:
35 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
36 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
37 ; X86-NEXT: shldl $1, %eax, %edx
38 ; X86-NEXT: addl %eax, %eax
41 ; X86-NOOPT-LABEL: test_mul_by_2:
43 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
44 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
45 ; X86-NOOPT-NEXT: shldl $1, %eax, %edx
46 ; X86-NOOPT-NEXT: addl %eax, %eax
47 ; X86-NOOPT-NEXT: retl
49 ; X64-LABEL: test_mul_by_2:
51 ; X64-NEXT: leaq (%rdi,%rdi), %rax
53 %mul = mul nsw i64 %x, 2
57 define i64 @test_mul_by_3(i64 %x) {
58 ; X86-LABEL: test_mul_by_3:
60 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
61 ; X86-NEXT: leal (%eax,%eax,2), %ecx
62 ; X86-NEXT: movl $3, %eax
63 ; X86-NEXT: mull {{[0-9]+}}(%esp)
64 ; X86-NEXT: addl %ecx, %edx
67 ; X86-NOOPT-LABEL: test_mul_by_3:
69 ; X86-NOOPT-NEXT: movl $3, %eax
70 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
71 ; X86-NOOPT-NEXT: imull $3, {{[0-9]+}}(%esp), %ecx
72 ; X86-NOOPT-NEXT: addl %ecx, %edx
73 ; X86-NOOPT-NEXT: retl
75 ; X64-LABEL: test_mul_by_3:
77 ; X64-NEXT: leaq (%rdi,%rdi,2), %rax
79 %mul = mul nsw i64 %x, 3
83 define i64 @test_mul_by_4(i64 %x) {
84 ; X86-LABEL: test_mul_by_4:
86 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
87 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
88 ; X86-NEXT: shldl $2, %eax, %edx
89 ; X86-NEXT: shll $2, %eax
92 ; X86-NOOPT-LABEL: test_mul_by_4:
94 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
95 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
96 ; X86-NOOPT-NEXT: shldl $2, %eax, %edx
97 ; X86-NOOPT-NEXT: shll $2, %eax
98 ; X86-NOOPT-NEXT: retl
100 ; X64-LABEL: test_mul_by_4:
102 ; X64-NEXT: leaq (,%rdi,4), %rax
104 %mul = mul nsw i64 %x, 4
108 define i64 @test_mul_by_5(i64 %x) {
109 ; X86-LABEL: test_mul_by_5:
111 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
112 ; X86-NEXT: leal (%eax,%eax,4), %ecx
113 ; X86-NEXT: movl $5, %eax
114 ; X86-NEXT: mull {{[0-9]+}}(%esp)
115 ; X86-NEXT: addl %ecx, %edx
118 ; X86-NOOPT-LABEL: test_mul_by_5:
119 ; X86-NOOPT: # %bb.0:
120 ; X86-NOOPT-NEXT: movl $5, %eax
121 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
122 ; X86-NOOPT-NEXT: imull $5, {{[0-9]+}}(%esp), %ecx
123 ; X86-NOOPT-NEXT: addl %ecx, %edx
124 ; X86-NOOPT-NEXT: retl
126 ; X64-LABEL: test_mul_by_5:
128 ; X64-NEXT: leaq (%rdi,%rdi,4), %rax
130 %mul = mul nsw i64 %x, 5
134 define i64 @test_mul_by_6(i64 %x) {
135 ; X86-LABEL: test_mul_by_6:
137 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
138 ; X86-NEXT: leal (%eax,%eax,2), %ecx
139 ; X86-NEXT: movl $6, %eax
140 ; X86-NEXT: mull {{[0-9]+}}(%esp)
141 ; X86-NEXT: leal (%edx,%ecx,2), %edx
144 ; X86-NOOPT-LABEL: test_mul_by_6:
145 ; X86-NOOPT: # %bb.0:
146 ; X86-NOOPT-NEXT: movl $6, %eax
147 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
148 ; X86-NOOPT-NEXT: imull $6, {{[0-9]+}}(%esp), %ecx
149 ; X86-NOOPT-NEXT: addl %ecx, %edx
150 ; X86-NOOPT-NEXT: retl
152 ; X64-OPT-LABEL: test_mul_by_6:
154 ; X64-OPT-NEXT: addq %rdi, %rdi
155 ; X64-OPT-NEXT: leaq (%rdi,%rdi,2), %rax
158 ; X64-NOOPT-LABEL: test_mul_by_6:
159 ; X64-NOOPT: # %bb.0:
160 ; X64-NOOPT-NEXT: imulq $6, %rdi, %rax
161 ; X64-NOOPT-NEXT: retq
162 %mul = mul nsw i64 %x, 6
166 define i64 @test_mul_by_7(i64 %x) {
167 ; X86-LABEL: test_mul_by_7:
169 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
170 ; X86-NEXT: leal (,%eax,8), %ecx
171 ; X86-NEXT: subl %eax, %ecx
172 ; X86-NEXT: movl $7, %eax
173 ; X86-NEXT: mull {{[0-9]+}}(%esp)
174 ; X86-NEXT: addl %ecx, %edx
177 ; X86-NOOPT-LABEL: test_mul_by_7:
178 ; X86-NOOPT: # %bb.0:
179 ; X86-NOOPT-NEXT: movl $7, %eax
180 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
181 ; X86-NOOPT-NEXT: imull $7, {{[0-9]+}}(%esp), %ecx
182 ; X86-NOOPT-NEXT: addl %ecx, %edx
183 ; X86-NOOPT-NEXT: retl
185 ; X64-OPT-LABEL: test_mul_by_7:
187 ; X64-OPT-NEXT: leaq (,%rdi,8), %rax
188 ; X64-OPT-NEXT: subq %rdi, %rax
191 ; X64-NOOPT-LABEL: test_mul_by_7:
192 ; X64-NOOPT: # %bb.0:
193 ; X64-NOOPT-NEXT: imulq $7, %rdi, %rax
194 ; X64-NOOPT-NEXT: retq
195 %mul = mul nsw i64 %x, 7
199 define i64 @test_mul_by_8(i64 %x) {
200 ; X86-LABEL: test_mul_by_8:
202 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
203 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
204 ; X86-NEXT: shldl $3, %eax, %edx
205 ; X86-NEXT: shll $3, %eax
208 ; X86-NOOPT-LABEL: test_mul_by_8:
209 ; X86-NOOPT: # %bb.0:
210 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
211 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
212 ; X86-NOOPT-NEXT: shldl $3, %eax, %edx
213 ; X86-NOOPT-NEXT: shll $3, %eax
214 ; X86-NOOPT-NEXT: retl
216 ; X64-LABEL: test_mul_by_8:
218 ; X64-NEXT: leaq (,%rdi,8), %rax
220 %mul = mul nsw i64 %x, 8
224 define i64 @test_mul_by_9(i64 %x) {
225 ; X86-LABEL: test_mul_by_9:
227 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
228 ; X86-NEXT: leal (%eax,%eax,8), %ecx
229 ; X86-NEXT: movl $9, %eax
230 ; X86-NEXT: mull {{[0-9]+}}(%esp)
231 ; X86-NEXT: addl %ecx, %edx
234 ; X86-NOOPT-LABEL: test_mul_by_9:
235 ; X86-NOOPT: # %bb.0:
236 ; X86-NOOPT-NEXT: movl $9, %eax
237 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
238 ; X86-NOOPT-NEXT: imull $9, {{[0-9]+}}(%esp), %ecx
239 ; X86-NOOPT-NEXT: addl %ecx, %edx
240 ; X86-NOOPT-NEXT: retl
242 ; X64-LABEL: test_mul_by_9:
244 ; X64-NEXT: leaq (%rdi,%rdi,8), %rax
246 %mul = mul nsw i64 %x, 9
250 define i64 @test_mul_by_10(i64 %x) {
251 ; X86-LABEL: test_mul_by_10:
253 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
254 ; X86-NEXT: leal (%eax,%eax,4), %ecx
255 ; X86-NEXT: movl $10, %eax
256 ; X86-NEXT: mull {{[0-9]+}}(%esp)
257 ; X86-NEXT: leal (%edx,%ecx,2), %edx
260 ; X86-NOOPT-LABEL: test_mul_by_10:
261 ; X86-NOOPT: # %bb.0:
262 ; X86-NOOPT-NEXT: movl $10, %eax
263 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
264 ; X86-NOOPT-NEXT: imull $10, {{[0-9]+}}(%esp), %ecx
265 ; X86-NOOPT-NEXT: addl %ecx, %edx
266 ; X86-NOOPT-NEXT: retl
268 ; X64-OPT-LABEL: test_mul_by_10:
270 ; X64-OPT-NEXT: addq %rdi, %rdi
271 ; X64-OPT-NEXT: leaq (%rdi,%rdi,4), %rax
274 ; X64-NOOPT-LABEL: test_mul_by_10:
275 ; X64-NOOPT: # %bb.0:
276 ; X64-NOOPT-NEXT: imulq $10, %rdi, %rax
277 ; X64-NOOPT-NEXT: retq
278 %mul = mul nsw i64 %x, 10
282 define i64 @test_mul_by_11(i64 %x) {
283 ; X86-LABEL: test_mul_by_11:
285 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
286 ; X86-NEXT: leal (%eax,%eax,4), %ecx
287 ; X86-NEXT: leal (%eax,%ecx,2), %ecx
288 ; X86-NEXT: movl $11, %eax
289 ; X86-NEXT: mull {{[0-9]+}}(%esp)
290 ; X86-NEXT: addl %ecx, %edx
293 ; X86-NOOPT-LABEL: test_mul_by_11:
294 ; X86-NOOPT: # %bb.0:
295 ; X86-NOOPT-NEXT: movl $11, %eax
296 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
297 ; X86-NOOPT-NEXT: imull $11, {{[0-9]+}}(%esp), %ecx
298 ; X86-NOOPT-NEXT: addl %ecx, %edx
299 ; X86-NOOPT-NEXT: retl
301 ; X64-HSW-LABEL: test_mul_by_11:
303 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
304 ; X64-HSW-NEXT: leaq (%rdi,%rax,2), %rax
307 ; X64-JAG-LABEL: test_mul_by_11:
309 ; X64-JAG-NEXT: leaq (%rdi,%rdi,4), %rax
310 ; X64-JAG-NEXT: leaq (%rdi,%rax,2), %rax
313 ; X64-SLM-LABEL: test_mul_by_11:
315 ; X64-SLM-NEXT: imulq $11, %rdi, %rax
318 ; X64-NOOPT-LABEL: test_mul_by_11:
319 ; X64-NOOPT: # %bb.0:
320 ; X64-NOOPT-NEXT: imulq $11, %rdi, %rax
321 ; X64-NOOPT-NEXT: retq
322 %mul = mul nsw i64 %x, 11
326 define i64 @test_mul_by_12(i64 %x) {
327 ; X86-LABEL: test_mul_by_12:
329 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
330 ; X86-NEXT: leal (%eax,%eax,2), %ecx
331 ; X86-NEXT: movl $12, %eax
332 ; X86-NEXT: mull {{[0-9]+}}(%esp)
333 ; X86-NEXT: leal (%edx,%ecx,4), %edx
336 ; X86-NOOPT-LABEL: test_mul_by_12:
337 ; X86-NOOPT: # %bb.0:
338 ; X86-NOOPT-NEXT: movl $12, %eax
339 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
340 ; X86-NOOPT-NEXT: imull $12, {{[0-9]+}}(%esp), %ecx
341 ; X86-NOOPT-NEXT: addl %ecx, %edx
342 ; X86-NOOPT-NEXT: retl
344 ; X64-OPT-LABEL: test_mul_by_12:
346 ; X64-OPT-NEXT: shlq $2, %rdi
347 ; X64-OPT-NEXT: leaq (%rdi,%rdi,2), %rax
350 ; X64-NOOPT-LABEL: test_mul_by_12:
351 ; X64-NOOPT: # %bb.0:
352 ; X64-NOOPT-NEXT: imulq $12, %rdi, %rax
353 ; X64-NOOPT-NEXT: retq
354 %mul = mul nsw i64 %x, 12
358 define i64 @test_mul_by_13(i64 %x) {
359 ; X86-LABEL: test_mul_by_13:
361 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
362 ; X86-NEXT: leal (%eax,%eax,2), %ecx
363 ; X86-NEXT: leal (%eax,%ecx,4), %ecx
364 ; X86-NEXT: movl $13, %eax
365 ; X86-NEXT: mull {{[0-9]+}}(%esp)
366 ; X86-NEXT: addl %ecx, %edx
369 ; X86-NOOPT-LABEL: test_mul_by_13:
370 ; X86-NOOPT: # %bb.0:
371 ; X86-NOOPT-NEXT: movl $13, %eax
372 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
373 ; X86-NOOPT-NEXT: imull $13, {{[0-9]+}}(%esp), %ecx
374 ; X86-NOOPT-NEXT: addl %ecx, %edx
375 ; X86-NOOPT-NEXT: retl
377 ; X64-HSW-LABEL: test_mul_by_13:
379 ; X64-HSW-NEXT: leaq (%rdi,%rdi,2), %rax
380 ; X64-HSW-NEXT: leaq (%rdi,%rax,4), %rax
383 ; X64-JAG-LABEL: test_mul_by_13:
385 ; X64-JAG-NEXT: leaq (%rdi,%rdi,2), %rax
386 ; X64-JAG-NEXT: leaq (%rdi,%rax,4), %rax
389 ; X64-SLM-LABEL: test_mul_by_13:
391 ; X64-SLM-NEXT: imulq $13, %rdi, %rax
394 ; X64-NOOPT-LABEL: test_mul_by_13:
395 ; X64-NOOPT: # %bb.0:
396 ; X64-NOOPT-NEXT: imulq $13, %rdi, %rax
397 ; X64-NOOPT-NEXT: retq
398 %mul = mul nsw i64 %x, 13
402 define i64 @test_mul_by_14(i64 %x) {
403 ; X86-LABEL: test_mul_by_14:
405 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
406 ; X86-NEXT: movl %eax, %ecx
407 ; X86-NEXT: shll $4, %ecx
408 ; X86-NEXT: subl %eax, %ecx
409 ; X86-NEXT: subl %eax, %ecx
410 ; X86-NEXT: movl $14, %eax
411 ; X86-NEXT: mull {{[0-9]+}}(%esp)
412 ; X86-NEXT: addl %ecx, %edx
415 ; X86-NOOPT-LABEL: test_mul_by_14:
416 ; X86-NOOPT: # %bb.0:
417 ; X86-NOOPT-NEXT: movl $14, %eax
418 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
419 ; X86-NOOPT-NEXT: imull $14, {{[0-9]+}}(%esp), %ecx
420 ; X86-NOOPT-NEXT: addl %ecx, %edx
421 ; X86-NOOPT-NEXT: retl
423 ; X64-OPT-LABEL: test_mul_by_14:
425 ; X64-OPT-NEXT: movq %rdi, %rax
426 ; X64-OPT-NEXT: shlq $4, %rax
427 ; X64-OPT-NEXT: subq %rdi, %rax
428 ; X64-OPT-NEXT: subq %rdi, %rax
431 ; X64-NOOPT-LABEL: test_mul_by_14:
432 ; X64-NOOPT: # %bb.0:
433 ; X64-NOOPT-NEXT: imulq $14, %rdi, %rax
434 ; X64-NOOPT-NEXT: retq
435 %mul = mul nsw i64 %x, 14
439 define i64 @test_mul_by_15(i64 %x) {
440 ; X86-LABEL: test_mul_by_15:
442 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
443 ; X86-NEXT: movl $15, %eax
444 ; X86-NEXT: mull {{[0-9]+}}(%esp)
445 ; X86-NEXT: leal (%ecx,%ecx,4), %ecx
446 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
447 ; X86-NEXT: addl %ecx, %edx
450 ; X86-NOOPT-LABEL: test_mul_by_15:
451 ; X86-NOOPT: # %bb.0:
452 ; X86-NOOPT-NEXT: movl $15, %eax
453 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
454 ; X86-NOOPT-NEXT: imull $15, {{[0-9]+}}(%esp), %ecx
455 ; X86-NOOPT-NEXT: addl %ecx, %edx
456 ; X86-NOOPT-NEXT: retl
458 ; X64-OPT-LABEL: test_mul_by_15:
460 ; X64-OPT-NEXT: leaq (%rdi,%rdi,4), %rax
461 ; X64-OPT-NEXT: leaq (%rax,%rax,2), %rax
464 ; X64-NOOPT-LABEL: test_mul_by_15:
465 ; X64-NOOPT: # %bb.0:
466 ; X64-NOOPT-NEXT: imulq $15, %rdi, %rax
467 ; X64-NOOPT-NEXT: retq
468 %mul = mul nsw i64 %x, 15
472 define i64 @test_mul_by_16(i64 %x) {
473 ; X86-LABEL: test_mul_by_16:
475 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
476 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
477 ; X86-NEXT: shldl $4, %eax, %edx
478 ; X86-NEXT: shll $4, %eax
481 ; X86-NOOPT-LABEL: test_mul_by_16:
482 ; X86-NOOPT: # %bb.0:
483 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
484 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
485 ; X86-NOOPT-NEXT: shldl $4, %eax, %edx
486 ; X86-NOOPT-NEXT: shll $4, %eax
487 ; X86-NOOPT-NEXT: retl
489 ; X64-LABEL: test_mul_by_16:
491 ; X64-NEXT: movq %rdi, %rax
492 ; X64-NEXT: shlq $4, %rax
494 %mul = mul nsw i64 %x, 16
498 define i64 @test_mul_by_17(i64 %x) {
499 ; X86-LABEL: test_mul_by_17:
501 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
502 ; X86-NEXT: movl %eax, %ecx
503 ; X86-NEXT: shll $4, %ecx
504 ; X86-NEXT: addl %eax, %ecx
505 ; X86-NEXT: movl $17, %eax
506 ; X86-NEXT: mull {{[0-9]+}}(%esp)
507 ; X86-NEXT: addl %ecx, %edx
510 ; X86-NOOPT-LABEL: test_mul_by_17:
511 ; X86-NOOPT: # %bb.0:
512 ; X86-NOOPT-NEXT: movl $17, %eax
513 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
514 ; X86-NOOPT-NEXT: imull $17, {{[0-9]+}}(%esp), %ecx
515 ; X86-NOOPT-NEXT: addl %ecx, %edx
516 ; X86-NOOPT-NEXT: retl
518 ; X64-OPT-LABEL: test_mul_by_17:
520 ; X64-OPT-NEXT: movq %rdi, %rax
521 ; X64-OPT-NEXT: shlq $4, %rax
522 ; X64-OPT-NEXT: addq %rdi, %rax
525 ; X64-NOOPT-LABEL: test_mul_by_17:
526 ; X64-NOOPT: # %bb.0:
527 ; X64-NOOPT-NEXT: imulq $17, %rdi, %rax
528 ; X64-NOOPT-NEXT: retq
529 %mul = mul nsw i64 %x, 17
533 define i64 @test_mul_by_18(i64 %x) {
534 ; X86-LABEL: test_mul_by_18:
536 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
537 ; X86-NEXT: leal (%eax,%eax,8), %ecx
538 ; X86-NEXT: movl $18, %eax
539 ; X86-NEXT: mull {{[0-9]+}}(%esp)
540 ; X86-NEXT: leal (%edx,%ecx,2), %edx
543 ; X86-NOOPT-LABEL: test_mul_by_18:
544 ; X86-NOOPT: # %bb.0:
545 ; X86-NOOPT-NEXT: movl $18, %eax
546 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
547 ; X86-NOOPT-NEXT: imull $18, {{[0-9]+}}(%esp), %ecx
548 ; X86-NOOPT-NEXT: addl %ecx, %edx
549 ; X86-NOOPT-NEXT: retl
551 ; X64-OPT-LABEL: test_mul_by_18:
553 ; X64-OPT-NEXT: addq %rdi, %rdi
554 ; X64-OPT-NEXT: leaq (%rdi,%rdi,8), %rax
557 ; X64-NOOPT-LABEL: test_mul_by_18:
558 ; X64-NOOPT: # %bb.0:
559 ; X64-NOOPT-NEXT: imulq $18, %rdi, %rax
560 ; X64-NOOPT-NEXT: retq
561 %mul = mul nsw i64 %x, 18
565 define i64 @test_mul_by_19(i64 %x) {
566 ; X86-LABEL: test_mul_by_19:
568 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
569 ; X86-NEXT: leal (%eax,%eax,8), %ecx
570 ; X86-NEXT: leal (%eax,%ecx,2), %ecx
571 ; X86-NEXT: movl $19, %eax
572 ; X86-NEXT: mull {{[0-9]+}}(%esp)
573 ; X86-NEXT: addl %ecx, %edx
576 ; X86-NOOPT-LABEL: test_mul_by_19:
577 ; X86-NOOPT: # %bb.0:
578 ; X86-NOOPT-NEXT: movl $19, %eax
579 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
580 ; X86-NOOPT-NEXT: imull $19, {{[0-9]+}}(%esp), %ecx
581 ; X86-NOOPT-NEXT: addl %ecx, %edx
582 ; X86-NOOPT-NEXT: retl
584 ; X64-HSW-LABEL: test_mul_by_19:
586 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rax
587 ; X64-HSW-NEXT: leaq (%rdi,%rax,2), %rax
590 ; X64-JAG-LABEL: test_mul_by_19:
592 ; X64-JAG-NEXT: leaq (%rdi,%rdi,8), %rax
593 ; X64-JAG-NEXT: leaq (%rdi,%rax,2), %rax
596 ; X64-SLM-LABEL: test_mul_by_19:
598 ; X64-SLM-NEXT: imulq $19, %rdi, %rax
601 ; X64-NOOPT-LABEL: test_mul_by_19:
602 ; X64-NOOPT: # %bb.0:
603 ; X64-NOOPT-NEXT: imulq $19, %rdi, %rax
604 ; X64-NOOPT-NEXT: retq
605 %mul = mul nsw i64 %x, 19
609 define i64 @test_mul_by_20(i64 %x) {
610 ; X86-LABEL: test_mul_by_20:
612 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
613 ; X86-NEXT: leal (%eax,%eax,4), %ecx
614 ; X86-NEXT: movl $20, %eax
615 ; X86-NEXT: mull {{[0-9]+}}(%esp)
616 ; X86-NEXT: leal (%edx,%ecx,4), %edx
619 ; X86-NOOPT-LABEL: test_mul_by_20:
620 ; X86-NOOPT: # %bb.0:
621 ; X86-NOOPT-NEXT: movl $20, %eax
622 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
623 ; X86-NOOPT-NEXT: imull $20, {{[0-9]+}}(%esp), %ecx
624 ; X86-NOOPT-NEXT: addl %ecx, %edx
625 ; X86-NOOPT-NEXT: retl
627 ; X64-OPT-LABEL: test_mul_by_20:
629 ; X64-OPT-NEXT: shlq $2, %rdi
630 ; X64-OPT-NEXT: leaq (%rdi,%rdi,4), %rax
633 ; X64-NOOPT-LABEL: test_mul_by_20:
634 ; X64-NOOPT: # %bb.0:
635 ; X64-NOOPT-NEXT: imulq $20, %rdi, %rax
636 ; X64-NOOPT-NEXT: retq
637 %mul = mul nsw i64 %x, 20
641 define i64 @test_mul_by_21(i64 %x) {
642 ; X86-LABEL: test_mul_by_21:
644 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
645 ; X86-NEXT: leal (%eax,%eax,4), %ecx
646 ; X86-NEXT: leal (%eax,%ecx,4), %ecx
647 ; X86-NEXT: movl $21, %eax
648 ; X86-NEXT: mull {{[0-9]+}}(%esp)
649 ; X86-NEXT: addl %ecx, %edx
652 ; X86-NOOPT-LABEL: test_mul_by_21:
653 ; X86-NOOPT: # %bb.0:
654 ; X86-NOOPT-NEXT: movl $21, %eax
655 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
656 ; X86-NOOPT-NEXT: imull $21, {{[0-9]+}}(%esp), %ecx
657 ; X86-NOOPT-NEXT: addl %ecx, %edx
658 ; X86-NOOPT-NEXT: retl
660 ; X64-HSW-LABEL: test_mul_by_21:
662 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
663 ; X64-HSW-NEXT: leaq (%rdi,%rax,4), %rax
666 ; X64-JAG-LABEL: test_mul_by_21:
668 ; X64-JAG-NEXT: leaq (%rdi,%rdi,4), %rax
669 ; X64-JAG-NEXT: leaq (%rdi,%rax,4), %rax
672 ; X64-SLM-LABEL: test_mul_by_21:
674 ; X64-SLM-NEXT: imulq $21, %rdi, %rax
677 ; X64-NOOPT-LABEL: test_mul_by_21:
678 ; X64-NOOPT: # %bb.0:
679 ; X64-NOOPT-NEXT: imulq $21, %rdi, %rax
680 ; X64-NOOPT-NEXT: retq
681 %mul = mul nsw i64 %x, 21
685 define i64 @test_mul_by_22(i64 %x) {
686 ; X86-LABEL: test_mul_by_22:
688 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
689 ; X86-NEXT: leal (%eax,%eax,4), %ecx
690 ; X86-NEXT: leal (%eax,%ecx,4), %ecx
691 ; X86-NEXT: addl %eax, %ecx
692 ; X86-NEXT: movl $22, %eax
693 ; X86-NEXT: mull {{[0-9]+}}(%esp)
694 ; X86-NEXT: addl %ecx, %edx
697 ; X86-NOOPT-LABEL: test_mul_by_22:
698 ; X86-NOOPT: # %bb.0:
699 ; X86-NOOPT-NEXT: movl $22, %eax
700 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
701 ; X86-NOOPT-NEXT: imull $22, {{[0-9]+}}(%esp), %ecx
702 ; X86-NOOPT-NEXT: addl %ecx, %edx
703 ; X86-NOOPT-NEXT: retl
705 ; X64-HSW-LABEL: test_mul_by_22:
707 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
708 ; X64-HSW-NEXT: leaq (%rdi,%rax,4), %rax
709 ; X64-HSW-NEXT: addq %rdi, %rax
712 ; X64-JAG-LABEL: test_mul_by_22:
714 ; X64-JAG-NEXT: leaq (%rdi,%rdi,4), %rax
715 ; X64-JAG-NEXT: leaq (%rdi,%rax,4), %rax
716 ; X64-JAG-NEXT: addq %rdi, %rax
719 ; X64-SLM-LABEL: test_mul_by_22:
721 ; X64-SLM-NEXT: imulq $22, %rdi, %rax
724 ; X64-NOOPT-LABEL: test_mul_by_22:
725 ; X64-NOOPT: # %bb.0:
726 ; X64-NOOPT-NEXT: imulq $22, %rdi, %rax
727 ; X64-NOOPT-NEXT: retq
728 %mul = mul nsw i64 %x, 22
732 define i64 @test_mul_by_23(i64 %x) {
733 ; X86-LABEL: test_mul_by_23:
735 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
736 ; X86-NEXT: leal (%eax,%eax,2), %ecx
737 ; X86-NEXT: shll $3, %ecx
738 ; X86-NEXT: subl %eax, %ecx
739 ; X86-NEXT: movl $23, %eax
740 ; X86-NEXT: mull {{[0-9]+}}(%esp)
741 ; X86-NEXT: addl %ecx, %edx
744 ; X86-NOOPT-LABEL: test_mul_by_23:
745 ; X86-NOOPT: # %bb.0:
746 ; X86-NOOPT-NEXT: movl $23, %eax
747 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
748 ; X86-NOOPT-NEXT: imull $23, {{[0-9]+}}(%esp), %ecx
749 ; X86-NOOPT-NEXT: addl %ecx, %edx
750 ; X86-NOOPT-NEXT: retl
752 ; X64-HSW-LABEL: test_mul_by_23:
754 ; X64-HSW-NEXT: leaq (%rdi,%rdi,2), %rax
755 ; X64-HSW-NEXT: shlq $3, %rax
756 ; X64-HSW-NEXT: subq %rdi, %rax
759 ; X64-JAG-LABEL: test_mul_by_23:
761 ; X64-JAG-NEXT: leaq (%rdi,%rdi,2), %rax
762 ; X64-JAG-NEXT: shlq $3, %rax
763 ; X64-JAG-NEXT: subq %rdi, %rax
766 ; X64-SLM-LABEL: test_mul_by_23:
768 ; X64-SLM-NEXT: imulq $23, %rdi, %rax
771 ; X64-NOOPT-LABEL: test_mul_by_23:
772 ; X64-NOOPT: # %bb.0:
773 ; X64-NOOPT-NEXT: imulq $23, %rdi, %rax
774 ; X64-NOOPT-NEXT: retq
775 %mul = mul nsw i64 %x, 23
779 define i64 @test_mul_by_24(i64 %x) {
780 ; X86-LABEL: test_mul_by_24:
782 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
783 ; X86-NEXT: leal (%eax,%eax,2), %ecx
784 ; X86-NEXT: movl $24, %eax
785 ; X86-NEXT: mull {{[0-9]+}}(%esp)
786 ; X86-NEXT: leal (%edx,%ecx,8), %edx
789 ; X86-NOOPT-LABEL: test_mul_by_24:
790 ; X86-NOOPT: # %bb.0:
791 ; X86-NOOPT-NEXT: movl $24, %eax
792 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
793 ; X86-NOOPT-NEXT: imull $24, {{[0-9]+}}(%esp), %ecx
794 ; X86-NOOPT-NEXT: addl %ecx, %edx
795 ; X86-NOOPT-NEXT: retl
797 ; X64-OPT-LABEL: test_mul_by_24:
799 ; X64-OPT-NEXT: shlq $3, %rdi
800 ; X64-OPT-NEXT: leaq (%rdi,%rdi,2), %rax
803 ; X64-NOOPT-LABEL: test_mul_by_24:
804 ; X64-NOOPT: # %bb.0:
805 ; X64-NOOPT-NEXT: imulq $24, %rdi, %rax
806 ; X64-NOOPT-NEXT: retq
807 %mul = mul nsw i64 %x, 24
811 define i64 @test_mul_by_25(i64 %x) {
812 ; X86-LABEL: test_mul_by_25:
814 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
815 ; X86-NEXT: movl $25, %eax
816 ; X86-NEXT: mull {{[0-9]+}}(%esp)
817 ; X86-NEXT: leal (%ecx,%ecx,4), %ecx
818 ; X86-NEXT: leal (%ecx,%ecx,4), %ecx
819 ; X86-NEXT: addl %ecx, %edx
822 ; X86-NOOPT-LABEL: test_mul_by_25:
823 ; X86-NOOPT: # %bb.0:
824 ; X86-NOOPT-NEXT: movl $25, %eax
825 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
826 ; X86-NOOPT-NEXT: imull $25, {{[0-9]+}}(%esp), %ecx
827 ; X86-NOOPT-NEXT: addl %ecx, %edx
828 ; X86-NOOPT-NEXT: retl
830 ; X64-OPT-LABEL: test_mul_by_25:
832 ; X64-OPT-NEXT: leaq (%rdi,%rdi,4), %rax
833 ; X64-OPT-NEXT: leaq (%rax,%rax,4), %rax
836 ; X64-NOOPT-LABEL: test_mul_by_25:
837 ; X64-NOOPT: # %bb.0:
838 ; X64-NOOPT-NEXT: imulq $25, %rdi, %rax
839 ; X64-NOOPT-NEXT: retq
840 %mul = mul nsw i64 %x, 25
844 define i64 @test_mul_by_26(i64 %x) {
845 ; X86-LABEL: test_mul_by_26:
847 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
848 ; X86-NEXT: leal (%eax,%eax,4), %ecx
849 ; X86-NEXT: leal (%ecx,%ecx,4), %ecx
850 ; X86-NEXT: addl %eax, %ecx
851 ; X86-NEXT: movl $26, %eax
852 ; X86-NEXT: mull {{[0-9]+}}(%esp)
853 ; X86-NEXT: addl %ecx, %edx
856 ; X86-NOOPT-LABEL: test_mul_by_26:
857 ; X86-NOOPT: # %bb.0:
858 ; X86-NOOPT-NEXT: movl $26, %eax
859 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
860 ; X86-NOOPT-NEXT: imull $26, {{[0-9]+}}(%esp), %ecx
861 ; X86-NOOPT-NEXT: addl %ecx, %edx
862 ; X86-NOOPT-NEXT: retl
864 ; X64-HSW-LABEL: test_mul_by_26:
866 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
867 ; X64-HSW-NEXT: leaq (%rax,%rax,4), %rax
868 ; X64-HSW-NEXT: addq %rdi, %rax
871 ; X64-JAG-LABEL: test_mul_by_26:
873 ; X64-JAG-NEXT: leaq (%rdi,%rdi,4), %rax
874 ; X64-JAG-NEXT: leaq (%rax,%rax,4), %rax
875 ; X64-JAG-NEXT: addq %rdi, %rax
878 ; X64-SLM-LABEL: test_mul_by_26:
880 ; X64-SLM-NEXT: imulq $26, %rdi, %rax
883 ; X64-NOOPT-LABEL: test_mul_by_26:
884 ; X64-NOOPT: # %bb.0:
885 ; X64-NOOPT-NEXT: imulq $26, %rdi, %rax
886 ; X64-NOOPT-NEXT: retq
887 %mul = mul nsw i64 %x, 26
891 define i64 @test_mul_by_27(i64 %x) {
892 ; X86-LABEL: test_mul_by_27:
894 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
895 ; X86-NEXT: movl $27, %eax
896 ; X86-NEXT: mull {{[0-9]+}}(%esp)
897 ; X86-NEXT: leal (%ecx,%ecx,8), %ecx
898 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
899 ; X86-NEXT: addl %ecx, %edx
902 ; X86-NOOPT-LABEL: test_mul_by_27:
903 ; X86-NOOPT: # %bb.0:
904 ; X86-NOOPT-NEXT: movl $27, %eax
905 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
906 ; X86-NOOPT-NEXT: imull $27, {{[0-9]+}}(%esp), %ecx
907 ; X86-NOOPT-NEXT: addl %ecx, %edx
908 ; X86-NOOPT-NEXT: retl
910 ; X64-OPT-LABEL: test_mul_by_27:
912 ; X64-OPT-NEXT: leaq (%rdi,%rdi,8), %rax
913 ; X64-OPT-NEXT: leaq (%rax,%rax,2), %rax
916 ; X64-NOOPT-LABEL: test_mul_by_27:
917 ; X64-NOOPT: # %bb.0:
918 ; X64-NOOPT-NEXT: imulq $27, %rdi, %rax
919 ; X64-NOOPT-NEXT: retq
920 %mul = mul nsw i64 %x, 27
924 define i64 @test_mul_by_28(i64 %x) {
925 ; X86-LABEL: test_mul_by_28:
927 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
928 ; X86-NEXT: leal (%eax,%eax,8), %ecx
929 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
930 ; X86-NEXT: addl %eax, %ecx
931 ; X86-NEXT: movl $28, %eax
932 ; X86-NEXT: mull {{[0-9]+}}(%esp)
933 ; X86-NEXT: addl %ecx, %edx
936 ; X86-NOOPT-LABEL: test_mul_by_28:
937 ; X86-NOOPT: # %bb.0:
938 ; X86-NOOPT-NEXT: movl $28, %eax
939 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
940 ; X86-NOOPT-NEXT: imull $28, {{[0-9]+}}(%esp), %ecx
941 ; X86-NOOPT-NEXT: addl %ecx, %edx
942 ; X86-NOOPT-NEXT: retl
944 ; X64-HSW-LABEL: test_mul_by_28:
946 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rax
947 ; X64-HSW-NEXT: leaq (%rax,%rax,2), %rax
948 ; X64-HSW-NEXT: addq %rdi, %rax
951 ; X64-JAG-LABEL: test_mul_by_28:
953 ; X64-JAG-NEXT: leaq (%rdi,%rdi,8), %rax
954 ; X64-JAG-NEXT: leaq (%rax,%rax,2), %rax
955 ; X64-JAG-NEXT: addq %rdi, %rax
958 ; X64-SLM-LABEL: test_mul_by_28:
960 ; X64-SLM-NEXT: imulq $28, %rdi, %rax
963 ; X64-NOOPT-LABEL: test_mul_by_28:
964 ; X64-NOOPT: # %bb.0:
965 ; X64-NOOPT-NEXT: imulq $28, %rdi, %rax
966 ; X64-NOOPT-NEXT: retq
967 %mul = mul nsw i64 %x, 28
971 define i64 @test_mul_by_29(i64 %x) {
972 ; X86-LABEL: test_mul_by_29:
974 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
975 ; X86-NEXT: leal (%eax,%eax,8), %ecx
976 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
977 ; X86-NEXT: addl %eax, %ecx
978 ; X86-NEXT: addl %eax, %ecx
979 ; X86-NEXT: movl $29, %eax
980 ; X86-NEXT: mull {{[0-9]+}}(%esp)
981 ; X86-NEXT: addl %ecx, %edx
984 ; X86-NOOPT-LABEL: test_mul_by_29:
985 ; X86-NOOPT: # %bb.0:
986 ; X86-NOOPT-NEXT: movl $29, %eax
987 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
988 ; X86-NOOPT-NEXT: imull $29, {{[0-9]+}}(%esp), %ecx
989 ; X86-NOOPT-NEXT: addl %ecx, %edx
990 ; X86-NOOPT-NEXT: retl
992 ; X64-HSW-LABEL: test_mul_by_29:
994 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rax
995 ; X64-HSW-NEXT: leaq (%rax,%rax,2), %rax
996 ; X64-HSW-NEXT: addq %rdi, %rax
997 ; X64-HSW-NEXT: addq %rdi, %rax
1000 ; X64-JAG-LABEL: test_mul_by_29:
1002 ; X64-JAG-NEXT: leaq (%rdi,%rdi,8), %rax
1003 ; X64-JAG-NEXT: leaq (%rax,%rax,2), %rax
1004 ; X64-JAG-NEXT: addq %rdi, %rax
1005 ; X64-JAG-NEXT: addq %rdi, %rax
1006 ; X64-JAG-NEXT: retq
1008 ; X64-SLM-LABEL: test_mul_by_29:
1010 ; X64-SLM-NEXT: imulq $29, %rdi, %rax
1011 ; X64-SLM-NEXT: retq
1013 ; X64-NOOPT-LABEL: test_mul_by_29:
1014 ; X64-NOOPT: # %bb.0:
1015 ; X64-NOOPT-NEXT: imulq $29, %rdi, %rax
1016 ; X64-NOOPT-NEXT: retq
1017 %mul = mul nsw i64 %x, 29
1021 define i64 @test_mul_by_30(i64 %x) {
1022 ; X86-LABEL: test_mul_by_30:
1024 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1025 ; X86-NEXT: movl %eax, %ecx
1026 ; X86-NEXT: shll $5, %ecx
1027 ; X86-NEXT: subl %eax, %ecx
1028 ; X86-NEXT: subl %eax, %ecx
1029 ; X86-NEXT: movl $30, %eax
1030 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1031 ; X86-NEXT: addl %ecx, %edx
1034 ; X86-NOOPT-LABEL: test_mul_by_30:
1035 ; X86-NOOPT: # %bb.0:
1036 ; X86-NOOPT-NEXT: movl $30, %eax
1037 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1038 ; X86-NOOPT-NEXT: imull $30, {{[0-9]+}}(%esp), %ecx
1039 ; X86-NOOPT-NEXT: addl %ecx, %edx
1040 ; X86-NOOPT-NEXT: retl
1042 ; X64-OPT-LABEL: test_mul_by_30:
1044 ; X64-OPT-NEXT: movq %rdi, %rax
1045 ; X64-OPT-NEXT: shlq $5, %rax
1046 ; X64-OPT-NEXT: subq %rdi, %rax
1047 ; X64-OPT-NEXT: subq %rdi, %rax
1048 ; X64-OPT-NEXT: retq
1050 ; X64-NOOPT-LABEL: test_mul_by_30:
1051 ; X64-NOOPT: # %bb.0:
1052 ; X64-NOOPT-NEXT: imulq $30, %rdi, %rax
1053 ; X64-NOOPT-NEXT: retq
1054 %mul = mul nsw i64 %x, 30
1058 define i64 @test_mul_by_31(i64 %x) {
1059 ; X86-LABEL: test_mul_by_31:
1061 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1062 ; X86-NEXT: movl %eax, %ecx
1063 ; X86-NEXT: shll $5, %ecx
1064 ; X86-NEXT: subl %eax, %ecx
1065 ; X86-NEXT: movl $31, %eax
1066 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1067 ; X86-NEXT: addl %ecx, %edx
1070 ; X86-NOOPT-LABEL: test_mul_by_31:
1071 ; X86-NOOPT: # %bb.0:
1072 ; X86-NOOPT-NEXT: movl $31, %eax
1073 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1074 ; X86-NOOPT-NEXT: imull $31, {{[0-9]+}}(%esp), %ecx
1075 ; X86-NOOPT-NEXT: addl %ecx, %edx
1076 ; X86-NOOPT-NEXT: retl
1078 ; X64-OPT-LABEL: test_mul_by_31:
1080 ; X64-OPT-NEXT: movq %rdi, %rax
1081 ; X64-OPT-NEXT: shlq $5, %rax
1082 ; X64-OPT-NEXT: subq %rdi, %rax
1083 ; X64-OPT-NEXT: retq
1085 ; X64-NOOPT-LABEL: test_mul_by_31:
1086 ; X64-NOOPT: # %bb.0:
1087 ; X64-NOOPT-NEXT: imulq $31, %rdi, %rax
1088 ; X64-NOOPT-NEXT: retq
1089 %mul = mul nsw i64 %x, 31
1093 define i64 @test_mul_by_32(i64 %x) {
1094 ; X86-LABEL: test_mul_by_32:
1096 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1097 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1098 ; X86-NEXT: shldl $5, %eax, %edx
1099 ; X86-NEXT: shll $5, %eax
1102 ; X86-NOOPT-LABEL: test_mul_by_32:
1103 ; X86-NOOPT: # %bb.0:
1104 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %eax
1105 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edx
1106 ; X86-NOOPT-NEXT: shldl $5, %eax, %edx
1107 ; X86-NOOPT-NEXT: shll $5, %eax
1108 ; X86-NOOPT-NEXT: retl
1110 ; X64-LABEL: test_mul_by_32:
1112 ; X64-NEXT: movq %rdi, %rax
1113 ; X64-NEXT: shlq $5, %rax
1115 %mul = mul nsw i64 %x, 32
1119 define i64 @test_mul_by_37(i64 %x) {
1120 ; X86-LABEL: test_mul_by_37:
1122 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1123 ; X86-NEXT: leal (%eax,%eax,8), %ecx
1124 ; X86-NEXT: leal (%eax,%ecx,4), %ecx
1125 ; X86-NEXT: movl $37, %eax
1126 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1127 ; X86-NEXT: addl %ecx, %edx
1130 ; X86-NOOPT-LABEL: test_mul_by_37:
1131 ; X86-NOOPT: # %bb.0:
1132 ; X86-NOOPT-NEXT: movl $37, %eax
1133 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1134 ; X86-NOOPT-NEXT: imull $37, {{[0-9]+}}(%esp), %ecx
1135 ; X86-NOOPT-NEXT: addl %ecx, %edx
1136 ; X86-NOOPT-NEXT: retl
1138 ; X64-HSW-LABEL: test_mul_by_37:
1140 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rax
1141 ; X64-HSW-NEXT: leaq (%rdi,%rax,4), %rax
1142 ; X64-HSW-NEXT: retq
1144 ; X64-JAG-LABEL: test_mul_by_37:
1146 ; X64-JAG-NEXT: leaq (%rdi,%rdi,8), %rax
1147 ; X64-JAG-NEXT: leaq (%rdi,%rax,4), %rax
1148 ; X64-JAG-NEXT: retq
1150 ; X64-SLM-LABEL: test_mul_by_37:
1152 ; X64-SLM-NEXT: imulq $37, %rdi, %rax
1153 ; X64-SLM-NEXT: retq
1155 ; X64-NOOPT-LABEL: test_mul_by_37:
1156 ; X64-NOOPT: # %bb.0:
1157 ; X64-NOOPT-NEXT: imulq $37, %rdi, %rax
1158 ; X64-NOOPT-NEXT: retq
1159 %mul = mul nsw i64 %x, 37
1163 define i64 @test_mul_by_41(i64 %x) {
1164 ; X86-LABEL: test_mul_by_41:
1166 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1167 ; X86-NEXT: leal (%eax,%eax,4), %ecx
1168 ; X86-NEXT: leal (%eax,%ecx,8), %ecx
1169 ; X86-NEXT: movl $41, %eax
1170 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1171 ; X86-NEXT: addl %ecx, %edx
1174 ; X86-NOOPT-LABEL: test_mul_by_41:
1175 ; X86-NOOPT: # %bb.0:
1176 ; X86-NOOPT-NEXT: movl $41, %eax
1177 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1178 ; X86-NOOPT-NEXT: imull $41, {{[0-9]+}}(%esp), %ecx
1179 ; X86-NOOPT-NEXT: addl %ecx, %edx
1180 ; X86-NOOPT-NEXT: retl
1182 ; X64-HSW-LABEL: test_mul_by_41:
1184 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
1185 ; X64-HSW-NEXT: leaq (%rdi,%rax,8), %rax
1186 ; X64-HSW-NEXT: retq
1188 ; X64-JAG-LABEL: test_mul_by_41:
1190 ; X64-JAG-NEXT: leaq (%rdi,%rdi,4), %rax
1191 ; X64-JAG-NEXT: leaq (%rdi,%rax,8), %rax
1192 ; X64-JAG-NEXT: retq
1194 ; X64-SLM-LABEL: test_mul_by_41:
1196 ; X64-SLM-NEXT: imulq $41, %rdi, %rax
1197 ; X64-SLM-NEXT: retq
1199 ; X64-NOOPT-LABEL: test_mul_by_41:
1200 ; X64-NOOPT: # %bb.0:
1201 ; X64-NOOPT-NEXT: imulq $41, %rdi, %rax
1202 ; X64-NOOPT-NEXT: retq
1203 %mul = mul nsw i64 %x, 41
1207 define i64 @test_mul_by_62(i64 %x) {
1208 ; X86-LABEL: test_mul_by_62:
1210 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1211 ; X86-NEXT: movl %eax, %ecx
1212 ; X86-NEXT: shll $6, %ecx
1213 ; X86-NEXT: subl %eax, %ecx
1214 ; X86-NEXT: subl %eax, %ecx
1215 ; X86-NEXT: movl $62, %eax
1216 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1217 ; X86-NEXT: addl %ecx, %edx
1220 ; X86-NOOPT-LABEL: test_mul_by_62:
1221 ; X86-NOOPT: # %bb.0:
1222 ; X86-NOOPT-NEXT: movl $62, %eax
1223 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1224 ; X86-NOOPT-NEXT: imull $62, {{[0-9]+}}(%esp), %ecx
1225 ; X86-NOOPT-NEXT: addl %ecx, %edx
1226 ; X86-NOOPT-NEXT: retl
1228 ; X64-OPT-LABEL: test_mul_by_62:
1230 ; X64-OPT-NEXT: movq %rdi, %rax
1231 ; X64-OPT-NEXT: shlq $6, %rax
1232 ; X64-OPT-NEXT: subq %rdi, %rax
1233 ; X64-OPT-NEXT: subq %rdi, %rax
1234 ; X64-OPT-NEXT: retq
1236 ; X64-NOOPT-LABEL: test_mul_by_62:
1237 ; X64-NOOPT: # %bb.0:
1238 ; X64-NOOPT-NEXT: imulq $62, %rdi, %rax
1239 ; X64-NOOPT-NEXT: retq
1240 %mul = mul nsw i64 %x, 62
1244 define i64 @test_mul_by_66(i64 %x) {
1245 ; X86-LABEL: test_mul_by_66:
1247 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1248 ; X86-NEXT: movl %eax, %ecx
1249 ; X86-NEXT: shll $6, %ecx
1250 ; X86-NEXT: leal (%ecx,%eax,2), %ecx
1251 ; X86-NEXT: movl $66, %eax
1252 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1253 ; X86-NEXT: addl %ecx, %edx
1256 ; X86-NOOPT-LABEL: test_mul_by_66:
1257 ; X86-NOOPT: # %bb.0:
1258 ; X86-NOOPT-NEXT: movl $66, %eax
1259 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1260 ; X86-NOOPT-NEXT: imull $66, {{[0-9]+}}(%esp), %ecx
1261 ; X86-NOOPT-NEXT: addl %ecx, %edx
1262 ; X86-NOOPT-NEXT: retl
1264 ; X64-HSW-LABEL: test_mul_by_66:
1266 ; X64-HSW-NEXT: movq %rdi, %rax
1267 ; X64-HSW-NEXT: shlq $6, %rax
1268 ; X64-HSW-NEXT: leaq (%rax,%rdi,2), %rax
1269 ; X64-HSW-NEXT: retq
1271 ; X64-JAG-LABEL: test_mul_by_66:
1273 ; X64-JAG-NEXT: movq %rdi, %rax
1274 ; X64-JAG-NEXT: shlq $6, %rax
1275 ; X64-JAG-NEXT: leaq (%rax,%rdi,2), %rax
1276 ; X64-JAG-NEXT: retq
1278 ; X64-SLM-LABEL: test_mul_by_66:
1280 ; X64-SLM-NEXT: movq %rdi, %rax
1281 ; X64-SLM-NEXT: shlq $6, %rax
1282 ; X64-SLM-NEXT: addq %rdi, %rax
1283 ; X64-SLM-NEXT: addq %rdi, %rax
1284 ; X64-SLM-NEXT: retq
1286 ; X64-NOOPT-LABEL: test_mul_by_66:
1287 ; X64-NOOPT: # %bb.0:
1288 ; X64-NOOPT-NEXT: imulq $66, %rdi, %rax
1289 ; X64-NOOPT-NEXT: retq
1290 %mul = mul nsw i64 %x, 66
1294 define i64 @test_mul_by_73(i64 %x) {
1295 ; X86-LABEL: test_mul_by_73:
1297 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1298 ; X86-NEXT: leal (%eax,%eax,8), %ecx
1299 ; X86-NEXT: leal (%eax,%ecx,8), %ecx
1300 ; X86-NEXT: movl $73, %eax
1301 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1302 ; X86-NEXT: addl %ecx, %edx
1305 ; X86-NOOPT-LABEL: test_mul_by_73:
1306 ; X86-NOOPT: # %bb.0:
1307 ; X86-NOOPT-NEXT: movl $73, %eax
1308 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1309 ; X86-NOOPT-NEXT: imull $73, {{[0-9]+}}(%esp), %ecx
1310 ; X86-NOOPT-NEXT: addl %ecx, %edx
1311 ; X86-NOOPT-NEXT: retl
1313 ; X64-HSW-LABEL: test_mul_by_73:
1315 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rax
1316 ; X64-HSW-NEXT: leaq (%rdi,%rax,8), %rax
1317 ; X64-HSW-NEXT: retq
1319 ; X64-JAG-LABEL: test_mul_by_73:
1321 ; X64-JAG-NEXT: leaq (%rdi,%rdi,8), %rax
1322 ; X64-JAG-NEXT: leaq (%rdi,%rax,8), %rax
1323 ; X64-JAG-NEXT: retq
1325 ; X64-SLM-LABEL: test_mul_by_73:
1327 ; X64-SLM-NEXT: imulq $73, %rdi, %rax
1328 ; X64-SLM-NEXT: retq
1330 ; X64-NOOPT-LABEL: test_mul_by_73:
1331 ; X64-NOOPT: # %bb.0:
1332 ; X64-NOOPT-NEXT: imulq $73, %rdi, %rax
1333 ; X64-NOOPT-NEXT: retq
1334 %mul = mul nsw i64 %x, 73
1338 define i64 @test_mul_by_520(i64 %x) {
1339 ; X86-LABEL: test_mul_by_520:
1341 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1342 ; X86-NEXT: movl %eax, %ecx
1343 ; X86-NEXT: shll $9, %ecx
1344 ; X86-NEXT: leal (%ecx,%eax,8), %ecx
1345 ; X86-NEXT: movl $520, %eax # imm = 0x208
1346 ; X86-NEXT: mull {{[0-9]+}}(%esp)
1347 ; X86-NEXT: addl %ecx, %edx
1350 ; X86-NOOPT-LABEL: test_mul_by_520:
1351 ; X86-NOOPT: # %bb.0:
1352 ; X86-NOOPT-NEXT: movl $520, %eax # imm = 0x208
1353 ; X86-NOOPT-NEXT: mull {{[0-9]+}}(%esp)
1354 ; X86-NOOPT-NEXT: imull $520, {{[0-9]+}}(%esp), %ecx # imm = 0x208
1355 ; X86-NOOPT-NEXT: addl %ecx, %edx
1356 ; X86-NOOPT-NEXT: retl
1358 ; X64-HSW-LABEL: test_mul_by_520:
1360 ; X64-HSW-NEXT: movq %rdi, %rax
1361 ; X64-HSW-NEXT: shlq $9, %rax
1362 ; X64-HSW-NEXT: leaq (%rax,%rdi,8), %rax
1363 ; X64-HSW-NEXT: retq
1365 ; X64-JAG-LABEL: test_mul_by_520:
1367 ; X64-JAG-NEXT: movq %rdi, %rax
1368 ; X64-JAG-NEXT: shlq $9, %rax
1369 ; X64-JAG-NEXT: leaq (%rax,%rdi,8), %rax
1370 ; X64-JAG-NEXT: retq
1372 ; X64-SLM-LABEL: test_mul_by_520:
1374 ; X64-SLM-NEXT: imulq $520, %rdi, %rax # imm = 0x208
1375 ; X64-SLM-NEXT: retq
1377 ; X64-NOOPT-LABEL: test_mul_by_520:
1378 ; X64-NOOPT: # %bb.0:
1379 ; X64-NOOPT-NEXT: imulq $520, %rdi, %rax # imm = 0x208
1380 ; X64-NOOPT-NEXT: retq
1381 %mul = mul nsw i64 %x, 520
1385 define i64 @test_mul_by_neg10(i64 %x) {
1386 ; X86-LABEL: test_mul_by_neg10:
1388 ; X86-NEXT: pushl %esi
1389 ; X86-NEXT: .cfi_def_cfa_offset 8
1390 ; X86-NEXT: .cfi_offset %esi, -8
1391 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
1392 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1393 ; X86-NEXT: movl $-10, %edx
1394 ; X86-NEXT: movl %ecx, %eax
1395 ; X86-NEXT: mull %edx
1396 ; X86-NEXT: subl %ecx, %edx
1397 ; X86-NEXT: addl %esi, %esi
1398 ; X86-NEXT: leal (%esi,%esi,4), %ecx
1399 ; X86-NEXT: subl %ecx, %edx
1400 ; X86-NEXT: popl %esi
1401 ; X86-NEXT: .cfi_def_cfa_offset 4
1404 ; X86-NOOPT-LABEL: test_mul_by_neg10:
1405 ; X86-NOOPT: # %bb.0:
1406 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %ecx
1407 ; X86-NOOPT-NEXT: movl $-10, %edx
1408 ; X86-NOOPT-NEXT: movl %ecx, %eax
1409 ; X86-NOOPT-NEXT: mull %edx
1410 ; X86-NOOPT-NEXT: subl %ecx, %edx
1411 ; X86-NOOPT-NEXT: imull $-10, {{[0-9]+}}(%esp), %ecx
1412 ; X86-NOOPT-NEXT: addl %ecx, %edx
1413 ; X86-NOOPT-NEXT: retl
1415 ; X64-OPT-LABEL: test_mul_by_neg10:
1417 ; X64-OPT-NEXT: addq %rdi, %rdi
1418 ; X64-OPT-NEXT: leaq (%rdi,%rdi,4), %rax
1419 ; X64-OPT-NEXT: negq %rax
1420 ; X64-OPT-NEXT: retq
1422 ; X64-NOOPT-LABEL: test_mul_by_neg10:
1423 ; X64-NOOPT: # %bb.0:
1424 ; X64-NOOPT-NEXT: imulq $-10, %rdi, %rax
1425 ; X64-NOOPT-NEXT: retq
1426 %mul = mul nsw i64 %x, -10
1430 define i64 @test_mul_by_neg36(i64 %x) {
1431 ; X86-LABEL: test_mul_by_neg36:
1433 ; X86-NEXT: pushl %esi
1434 ; X86-NEXT: .cfi_def_cfa_offset 8
1435 ; X86-NEXT: .cfi_offset %esi, -8
1436 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
1437 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1438 ; X86-NEXT: movl $-36, %edx
1439 ; X86-NEXT: movl %ecx, %eax
1440 ; X86-NEXT: mull %edx
1441 ; X86-NEXT: subl %ecx, %edx
1442 ; X86-NEXT: shll $2, %esi
1443 ; X86-NEXT: leal (%esi,%esi,8), %ecx
1444 ; X86-NEXT: subl %ecx, %edx
1445 ; X86-NEXT: popl %esi
1446 ; X86-NEXT: .cfi_def_cfa_offset 4
1449 ; X86-NOOPT-LABEL: test_mul_by_neg36:
1450 ; X86-NOOPT: # %bb.0:
1451 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %ecx
1452 ; X86-NOOPT-NEXT: movl $-36, %edx
1453 ; X86-NOOPT-NEXT: movl %ecx, %eax
1454 ; X86-NOOPT-NEXT: mull %edx
1455 ; X86-NOOPT-NEXT: subl %ecx, %edx
1456 ; X86-NOOPT-NEXT: imull $-36, {{[0-9]+}}(%esp), %ecx
1457 ; X86-NOOPT-NEXT: addl %ecx, %edx
1458 ; X86-NOOPT-NEXT: retl
1460 ; X64-OPT-LABEL: test_mul_by_neg36:
1462 ; X64-OPT-NEXT: shlq $2, %rdi
1463 ; X64-OPT-NEXT: leaq (%rdi,%rdi,8), %rax
1464 ; X64-OPT-NEXT: negq %rax
1465 ; X64-OPT-NEXT: retq
1467 ; X64-NOOPT-LABEL: test_mul_by_neg36:
1468 ; X64-NOOPT: # %bb.0:
1469 ; X64-NOOPT-NEXT: imulq $-36, %rdi, %rax
1470 ; X64-NOOPT-NEXT: retq
1471 %mul = mul nsw i64 %x, -36
1476 define i64 @test_mul_spec(i64 %x) nounwind {
1477 ; X86-LABEL: test_mul_spec:
1479 ; X86-NEXT: pushl %ebx
1480 ; X86-NEXT: pushl %edi
1481 ; X86-NEXT: pushl %esi
1482 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
1483 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
1484 ; X86-NEXT: movl $9, %edx
1485 ; X86-NEXT: movl %ecx, %eax
1486 ; X86-NEXT: mull %edx
1487 ; X86-NEXT: movl %eax, %esi
1488 ; X86-NEXT: leal (%edi,%edi,8), %ebx
1489 ; X86-NEXT: addl $42, %esi
1490 ; X86-NEXT: adcl %edx, %ebx
1491 ; X86-NEXT: movl $5, %edx
1492 ; X86-NEXT: movl %ecx, %eax
1493 ; X86-NEXT: mull %edx
1494 ; X86-NEXT: movl %eax, %ecx
1495 ; X86-NEXT: leal (%edi,%edi,4), %edi
1496 ; X86-NEXT: addl $2, %ecx
1497 ; X86-NEXT: adcl %edx, %edi
1498 ; X86-NEXT: movl %esi, %eax
1499 ; X86-NEXT: mull %ecx
1500 ; X86-NEXT: imull %esi, %edi
1501 ; X86-NEXT: addl %edi, %edx
1502 ; X86-NEXT: imull %ebx, %ecx
1503 ; X86-NEXT: addl %ecx, %edx
1504 ; X86-NEXT: popl %esi
1505 ; X86-NEXT: popl %edi
1506 ; X86-NEXT: popl %ebx
1509 ; X86-NOOPT-LABEL: test_mul_spec:
1510 ; X86-NOOPT: # %bb.0:
1511 ; X86-NOOPT-NEXT: pushl %ebx
1512 ; X86-NOOPT-NEXT: pushl %edi
1513 ; X86-NOOPT-NEXT: pushl %esi
1514 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %ecx
1515 ; X86-NOOPT-NEXT: movl {{[0-9]+}}(%esp), %edi
1516 ; X86-NOOPT-NEXT: movl $9, %edx
1517 ; X86-NOOPT-NEXT: movl %ecx, %eax
1518 ; X86-NOOPT-NEXT: mull %edx
1519 ; X86-NOOPT-NEXT: movl %eax, %esi
1520 ; X86-NOOPT-NEXT: leal (%edi,%edi,8), %ebx
1521 ; X86-NOOPT-NEXT: addl $42, %esi
1522 ; X86-NOOPT-NEXT: adcl %edx, %ebx
1523 ; X86-NOOPT-NEXT: movl $5, %edx
1524 ; X86-NOOPT-NEXT: movl %ecx, %eax
1525 ; X86-NOOPT-NEXT: mull %edx
1526 ; X86-NOOPT-NEXT: movl %eax, %ecx
1527 ; X86-NOOPT-NEXT: leal (%edi,%edi,4), %edi
1528 ; X86-NOOPT-NEXT: addl $2, %ecx
1529 ; X86-NOOPT-NEXT: adcl %edx, %edi
1530 ; X86-NOOPT-NEXT: movl %esi, %eax
1531 ; X86-NOOPT-NEXT: mull %ecx
1532 ; X86-NOOPT-NEXT: imull %esi, %edi
1533 ; X86-NOOPT-NEXT: addl %edi, %edx
1534 ; X86-NOOPT-NEXT: imull %ebx, %ecx
1535 ; X86-NOOPT-NEXT: addl %ecx, %edx
1536 ; X86-NOOPT-NEXT: popl %esi
1537 ; X86-NOOPT-NEXT: popl %edi
1538 ; X86-NOOPT-NEXT: popl %ebx
1539 ; X86-NOOPT-NEXT: retl
1541 ; X64-HSW-LABEL: test_mul_spec:
1543 ; X64-HSW-NEXT: leaq (%rdi,%rdi,8), %rcx
1544 ; X64-HSW-NEXT: addq $42, %rcx
1545 ; X64-HSW-NEXT: leaq (%rdi,%rdi,4), %rax
1546 ; X64-HSW-NEXT: addq $2, %rax
1547 ; X64-HSW-NEXT: imulq %rcx, %rax
1548 ; X64-HSW-NEXT: retq
1550 ; X64-JAG-LABEL: test_mul_spec:
1552 ; X64-JAG-NEXT: leaq 42(%rdi,%rdi,8), %rcx
1553 ; X64-JAG-NEXT: leaq 2(%rdi,%rdi,4), %rax
1554 ; X64-JAG-NEXT: imulq %rcx, %rax
1555 ; X64-JAG-NEXT: retq
1557 ; X64-SLM-LABEL: test_mul_spec:
1559 ; X64-SLM-NEXT: leaq 42(%rdi,%rdi,8), %rcx
1560 ; X64-SLM-NEXT: leaq 2(%rdi,%rdi,4), %rax
1561 ; X64-SLM-NEXT: imulq %rcx, %rax
1562 ; X64-SLM-NEXT: retq
1564 ; X64-HSW-NOOPT-LABEL: test_mul_spec:
1565 ; X64-HSW-NOOPT: # %bb.0:
1566 ; X64-HSW-NOOPT-NEXT: leaq (%rdi,%rdi,8), %rcx
1567 ; X64-HSW-NOOPT-NEXT: addq $42, %rcx
1568 ; X64-HSW-NOOPT-NEXT: leaq (%rdi,%rdi,4), %rax
1569 ; X64-HSW-NOOPT-NEXT: addq $2, %rax
1570 ; X64-HSW-NOOPT-NEXT: imulq %rcx, %rax
1571 ; X64-HSW-NOOPT-NEXT: retq
1573 ; X64-JAG-NOOPT-LABEL: test_mul_spec:
1574 ; X64-JAG-NOOPT: # %bb.0:
1575 ; X64-JAG-NOOPT-NEXT: leaq 42(%rdi,%rdi,8), %rcx
1576 ; X64-JAG-NOOPT-NEXT: leaq 2(%rdi,%rdi,4), %rax
1577 ; X64-JAG-NOOPT-NEXT: imulq %rcx, %rax
1578 ; X64-JAG-NOOPT-NEXT: retq
1580 ; X64-SLM-NOOPT-LABEL: test_mul_spec:
1581 ; X64-SLM-NOOPT: # %bb.0:
1582 ; X64-SLM-NOOPT-NEXT: leaq 42(%rdi,%rdi,8), %rcx
1583 ; X64-SLM-NOOPT-NEXT: leaq 2(%rdi,%rdi,4), %rax
1584 ; X64-SLM-NOOPT-NEXT: imulq %rcx, %rax
1585 ; X64-SLM-NOOPT-NEXT: retq
1586 %mul = mul nsw i64 %x, 9
1587 %add = add nsw i64 %mul, 42
1588 %mul2 = mul nsw i64 %x, 5
1589 %add2 = add nsw i64 %mul2, 2
1590 %mul3 = mul nsw i64 %add, %add2