diff options
Diffstat (limited to 'llvm/test/CodeGen/X86/mul-constant-i32.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/mul-constant-i32.ll | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/mul-constant-i32.ll b/llvm/test/CodeGen/X86/mul-constant-i32.ll index 3c0c6c83392..658a6538bbd 100644 --- a/llvm/test/CodeGen/X86/mul-constant-i32.ll +++ b/llvm/test/CodeGen/X86/mul-constant-i32.ll @@ -1833,6 +1833,66 @@ define i32 @test_mul_by_62(i32 %x) { ret i32 %mul } +define i32 @test_mul_by_66(i32 %x) { +; X86-LABEL: test_mul_by_66: +; X86: # %bb.0: +; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-NEXT: movl %ecx, %eax +; X86-NEXT: shll $6, %eax +; X86-NEXT: addl %ecx, %eax +; X86-NEXT: addl %ecx, %eax +; X86-NEXT: retl +; +; X64-HSW-LABEL: test_mul_by_66: +; X64-HSW: # %bb.0: +; X64-HSW-NEXT: # kill: def $edi killed $edi def $rdi +; X64-HSW-NEXT: movl %edi, %eax # sched: [1:0.25] +; X64-HSW-NEXT: shll $6, %eax # sched: [1:0.50] +; X64-HSW-NEXT: leal (%rax,%rdi), %eax # sched: [1:0.50] +; X64-HSW-NEXT: addl %edi, %eax # sched: [1:0.25] +; X64-HSW-NEXT: retq # sched: [7:1.00] +; +; X64-JAG-LABEL: test_mul_by_66: +; X64-JAG: # %bb.0: +; X64-JAG-NEXT: # kill: def $edi killed $edi def $rdi +; X64-JAG-NEXT: movl %edi, %eax # sched: [1:0.50] +; X64-JAG-NEXT: shll $6, %eax # sched: [1:0.50] +; X64-JAG-NEXT: leal (%rax,%rdi), %eax # sched: [1:0.50] +; X64-JAG-NEXT: addl %edi, %eax # sched: [1:0.50] +; X64-JAG-NEXT: retq # sched: [4:1.00] +; +; X86-NOOPT-LABEL: test_mul_by_66: +; X86-NOOPT: # %bb.0: +; X86-NOOPT-NEXT: imull $66, {{[0-9]+}}(%esp), %eax +; X86-NOOPT-NEXT: retl +; +; HSW-NOOPT-LABEL: test_mul_by_66: +; HSW-NOOPT: # %bb.0: +; HSW-NOOPT-NEXT: imull $66, %edi, %eax # sched: [3:1.00] +; HSW-NOOPT-NEXT: retq # sched: [7:1.00] +; +; JAG-NOOPT-LABEL: test_mul_by_66: +; JAG-NOOPT: # %bb.0: +; JAG-NOOPT-NEXT: imull $66, %edi, %eax # sched: [3:1.00] +; JAG-NOOPT-NEXT: retq # sched: [4:1.00] +; +; X64-SLM-LABEL: test_mul_by_66: +; X64-SLM: # %bb.0: +; X64-SLM-NEXT: # kill: def $edi killed $edi def $rdi +; X64-SLM-NEXT: movl %edi, %eax # sched: [1:0.50] +; X64-SLM-NEXT: shll $6, %eax # sched: [1:1.00] +; X64-SLM-NEXT: leal (%rax,%rdi), %eax # sched: [1:1.00] +; X64-SLM-NEXT: addl %edi, %eax # sched: [1:0.50] +; X64-SLM-NEXT: retq # sched: [4:1.00] +; +; SLM-NOOPT-LABEL: test_mul_by_66: +; SLM-NOOPT: # %bb.0: +; SLM-NOOPT-NEXT: imull $66, %edi, %eax # sched: [3:1.00] +; SLM-NOOPT-NEXT: retq # sched: [4:1.00] + %mul = mul nsw i32 %x, 66 + ret i32 %mul +} + define i32 @test_mul_by_73(i32 %x) { ; X86-LABEL: test_mul_by_73: ; X86: # %bb.0: |

