[llvm] r330797 - [X86] Auto-generate complete checks. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 24 20:40:45 PDT 2018


Author: ctopper
Date: Tue Apr 24 20:40:45 2018
New Revision: 330797

URL: http://llvm.org/viewvc/llvm-project?rev=330797&view=rev
Log:
[X86] Auto-generate complete checks. NFC

Modified:
    llvm/trunk/test/CodeGen/X86/imul.ll

Modified: llvm/trunk/test/CodeGen/X86/imul.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/imul.ll?rev=330797&r1=330796&r2=330797&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/imul.ll (original)
+++ llvm/trunk/test/CodeGen/X86/imul.ll Tue Apr 24 20:40:45 2018
@@ -1,173 +1,298 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu | FileCheck %s --check-prefix=X64
 ; RUN: llc < %s -mtriple=x86_64-pc-linux-gnux32 | FileCheck %s --check-prefix=X64
 ; RUN: llc < %s -mtriple=i686-pc-linux | FileCheck %s --check-prefix=X86
 
 define i32 @mul4_32(i32 %A) {
 ; X64-LABEL: mul4_32:
-; X64: leal
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $edi killed $edi def $rdi
+; X64-NEXT:    leal (,%rdi,4), %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul4_32:
-; X86: shll
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    shll $2, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 4
     ret i32 %mul
 }
 
 define i64 @mul4_64(i64 %A) {
 ; X64-LABEL: mul4_64:
-; X64: leaq
+; X64:       # %bb.0:
+; X64-NEXT:    leaq (,%rdi,4), %rax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul4_64:
-; X86: shldl
-; X86: shll
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; X86-NEXT:    shldl $2, %eax, %edx
+; X86-NEXT:    shll $2, %eax
+; X86-NEXT:    retl
     %mul = mul i64 %A, 4
     ret i64 %mul
 }
 
 define i32 @mul4096_32(i32 %A) {
 ; X64-LABEL: mul4096_32:
-; X64: shll
+; X64:       # %bb.0:
+; X64-NEXT:    shll $12, %edi
+; X64-NEXT:    movl %edi, %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul4096_32:
-; X86: shll
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    shll $12, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 4096
     ret i32 %mul
 }
 
 define i64 @mul4096_64(i64 %A) {
 ; X64-LABEL: mul4096_64:
-; X64: shlq
+; X64:       # %bb.0:
+; X64-NEXT:    shlq $12, %rdi
+; X64-NEXT:    movq %rdi, %rax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul4096_64:
-; X86: shldl
-; X86: shll
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; X86-NEXT:    shldl $12, %eax, %edx
+; X86-NEXT:    shll $12, %eax
+; X86-NEXT:    retl
     %mul = mul i64 %A, 4096
     ret i64 %mul
 }
 
 define i32 @mulmin4096_32(i32 %A) {
 ; X64-LABEL: mulmin4096_32:
-; X64: shll
-; X64-NEXT: negl
+; X64:       # %bb.0:
+; X64-NEXT:    shll $12, %edi
+; X64-NEXT:    negl %edi
+; X64-NEXT:    movl %edi, %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mulmin4096_32:
-; X86: shll
-; X86-NEXT: negl
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    shll $12, %eax
+; X86-NEXT:    negl %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, -4096
     ret i32 %mul
 }
 
 define i64 @mulmin4096_64(i64 %A) {
 ; X64-LABEL: mulmin4096_64:
-; X64: shlq
-; X64-NEXT: negq
+; X64:       # %bb.0:
+; X64-NEXT:    shlq $12, %rdi
+; X64-NEXT:    negq %rdi
+; X64-NEXT:    movq %rdi, %rax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mulmin4096_64:
-; X86: shldl
-; X86-NEXT: shll
-; X86-NEXT: xorl
-; X86-NEXT: negl
-; X86-NEXT: sbbl
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    shldl $12, %eax, %ecx
+; X86-NEXT:    shll $12, %eax
+; X86-NEXT:    xorl %edx, %edx
+; X86-NEXT:    negl %eax
+; X86-NEXT:    sbbl %ecx, %edx
+; X86-NEXT:    retl
     %mul = mul i64 %A, -4096
     ret i64 %mul
 }
 
 define i32 @mul3_32(i32 %A) {
 ; X64-LABEL: mul3_32:
-; X64: leal
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $edi killed $edi def $rdi
+; X64-NEXT:    leal (%rdi,%rdi,2), %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul3_32:
+; X86:       # %bb.0:
+; X86-NEXT:    imull $3, {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    retl
 ; But why?!
-; X86: imull
     %mul = mul i32 %A, 3
     ret i32 %mul
 }
 
 define i64 @mul3_64(i64 %A) {
 ; X64-LABEL: mul3_64:
-; X64: leaq
+; X64:       # %bb.0:
+; X64-NEXT:    leaq (%rdi,%rdi,2), %rax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul3_64:
-; X86: mull
-; X86-NEXT: imull
+; X86:       # %bb.0:
+; X86-NEXT:    movl $3, %eax
+; X86-NEXT:    mull {{[0-9]+}}(%esp)
+; X86-NEXT:    imull $3, {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    addl %ecx, %edx
+; X86-NEXT:    retl
     %mul = mul i64 %A, 3
     ret i64 %mul
 }
 
 define i32 @mul40_32(i32 %A) {
 ; X64-LABEL: mul40_32:
-; X64: shll
-; X64-NEXT: leal
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $edi killed $edi def $rdi
+; X64-NEXT:    shll $3, %edi
+; X64-NEXT:    leal (%rdi,%rdi,4), %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul40_32:
-; X86: shll
-; X86-NEXT: leal
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    shll $3, %eax
+; X86-NEXT:    leal (%eax,%eax,4), %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 40
     ret i32 %mul
 }
 
 define i64 @mul40_64(i64 %A) {
 ; X64-LABEL: mul40_64:
-; X64: shlq
-; X64-NEXT: leaq
+; X64:       # %bb.0:
+; X64-NEXT:    shlq $3, %rdi
+; X64-NEXT:    leaq (%rdi,%rdi,4), %rax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul40_64:
-; X86: leal
-; X86-NEXT: movl
-; X86-NEXT: mull
-; X86-NEXT: leal
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    leal (%eax,%eax,4), %ecx
+; X86-NEXT:    movl $40, %eax
+; X86-NEXT:    mull {{[0-9]+}}(%esp)
+; X86-NEXT:    leal (%edx,%ecx,8), %edx
+; X86-NEXT:    retl
     %mul = mul i64 %A, 40
     ret i64 %mul
 }
 
 define i32 @mul4_32_minsize(i32 %A) minsize {
 ; X64-LABEL: mul4_32_minsize:
-; X64: leal
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $edi killed $edi def $rdi
+; X64-NEXT:    leal (,%rdi,4), %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul4_32_minsize:
-; X86: shll
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    shll $2, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 4
     ret i32 %mul
 }
 
 define i32 @mul40_32_minsize(i32 %A) minsize {
 ; X64-LABEL: mul40_32_minsize:
-; X64: imull
+; X64:       # %bb.0:
+; X64-NEXT:    imull $40, %edi, %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul40_32_minsize:
-; X86: imull
+; X86:       # %bb.0:
+; X86-NEXT:    imull $40, {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 40
     ret i32 %mul
 }
 
 define i32 @mul33_32(i32 %A) {
 ; X64-LABEL: mul33_32:
-; X64: shll
-; X64-NEXT: leal
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $edi killed $edi def $rdi
+; X64-NEXT:    movl %edi, %eax
+; X64-NEXT:    shll $5, %eax
+; X64-NEXT:    leal (%rax,%rdi), %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul33_32:
-; X86: shll
-; X86-NEXT: addl
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    movl %ecx, %eax
+; X86-NEXT:    shll $5, %eax
+; X86-NEXT:    addl %ecx, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 33
     ret i32 %mul
 }
 
 define i32 @mul31_32(i32 %A) {
 ; X64-LABEL: mul31_32:
-; X64: shll
-; X64-NEXT: subl
+; X64:       # %bb.0:
+; X64-NEXT:    movl %edi, %eax
+; X64-NEXT:    shll $5, %eax
+; X64-NEXT:    subl %edi, %eax
+; X64-NEXT:    retq
+;
 ; X86-LABEL: mul31_32:
-; X86: shll
-; X86-NEXT: subl
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    movl %ecx, %eax
+; X86-NEXT:    shll $5, %eax
+; X86-NEXT:    subl %ecx, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 31
     ret i32 %mul
 }
 
 define i32 @mul0_32(i32 %A) {
 ; X64-LABEL: mul0_32:
-; X64: xorl	%eax, %eax
+; X64:       # %bb.0:
+; X64-NEXT:    xorl %eax, %eax
+; X64-NEXT:    retq
+;
+; X86-LABEL: mul0_32:
+; X86:       # %bb.0:
+; X86-NEXT:    xorl %eax, %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 0
     ret i32 %mul
 }
 
 define i32 @mul4294967295_32(i32 %A) {
 ; X64-LABEL: mul4294967295_32:
-; X64: negl	%edi
-; X64-NEXT:	movl	%edi, %eax
+; X64:       # %bb.0:
+; X64-NEXT:    negl %edi
+; X64-NEXT:    movl %edi, %eax
+; X64-NEXT:    retq
+;
+; X86-LABEL: mul4294967295_32:
+; X86:       # %bb.0:
+; X86-NEXT:    xorl %eax, %eax
+; X86-NEXT:    subl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    retl
     %mul = mul i32 %A, 4294967295
     ret i32 %mul
 }
 
 define i64 @mul18446744073709551615_64(i64 %A) {
 ; X64-LABEL: mul18446744073709551615_64:
-; X64: negq	%rdi
-; X64-NEXT:	movq	%rdi, %rax
+; X64:       # %bb.0:
+; X64-NEXT:    negq %rdi
+; X64-NEXT:    movq %rdi, %rax
+; X64-NEXT:    retq
+;
+; X86-LABEL: mul18446744073709551615_64:
+; X86:       # %bb.0:
+; X86-NEXT:    xorl %edx, %edx
+; X86-NEXT:    xorl %eax, %eax
+; X86-NEXT:    subl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    sbbl {{[0-9]+}}(%esp), %edx
+; X86-NEXT:    retl
     %mul = mul i64 %A, 18446744073709551615
     ret i64 %mul
 }




More information about the llvm-commits mailing list