[X86][Haswell]: Updating the scheduling information for the Haswell subtarget.

Updated the scheduling information for the Haswell subtarget with the following changes:

Regrouped the instructions after adding appropriate load + store latencies.
Added scheduling for missing instructions such as the GATHER instrs.
The changes were made after revisiting the latencies impact of all memory uOps.

Reviewers: RKSimon, zvi, craig.topper, apilipenko
Differential Revision: https://reviews.llvm.org/D40021

Change-Id: Iaf6c1f5169add1552845a8a566af4e5a359217a7
llvm-svn: 320137
diff --git a/llvm/test/CodeGen/X86/sse42-schedule.ll b/llvm/test/CodeGen/X86/sse42-schedule.ll
index fef2691..1eaedea 100644
--- a/llvm/test/CodeGen/X86/sse42-schedule.ll
+++ b/llvm/test/CodeGen/X86/sse42-schedule.ll
@@ -35,9 +35,9 @@
 ; HASWELL-LABEL: crc32_32_8:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
-; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [7:1.00]
+; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
 ; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: crc32_32_8:
 ; BROADWELL:       # %bb.0:
@@ -105,9 +105,9 @@
 ; HASWELL-LABEL: crc32_32_16:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    crc32w %si, %edi # sched: [3:1.00]
-; HASWELL-NEXT:    crc32w (%rdx), %edi # sched: [7:1.00]
+; HASWELL-NEXT:    crc32w (%rdx), %edi # sched: [8:1.00]
 ; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: crc32_32_16:
 ; BROADWELL:       # %bb.0:
@@ -175,9 +175,9 @@
 ; HASWELL-LABEL: crc32_32_32:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
-; HASWELL-NEXT:    crc32l (%rdx), %edi # sched: [7:1.00]
+; HASWELL-NEXT:    crc32l (%rdx), %edi # sched: [8:1.00]
 ; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: crc32_32_32:
 ; BROADWELL:       # %bb.0:
@@ -245,9 +245,9 @@
 ; HASWELL-LABEL: crc32_64_8:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
-; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [7:1.00]
+; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
 ; HASWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: crc32_64_8:
 ; BROADWELL:       # %bb.0:
@@ -315,9 +315,9 @@
 ; HASWELL-LABEL: crc32_64_64:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
-; HASWELL-NEXT:    crc32q (%rdx), %rdi # sched: [7:1.00]
+; HASWELL-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
 ; HASWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: crc32_64_64:
 ; BROADWELL:       # %bb.0:
@@ -408,10 +408,10 @@
 ; HASWELL-NEXT:    movl %ecx, %esi # sched: [1:0.25]
 ; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
 ; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
-; HASWELL-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [18:4.00]
+; HASWELL-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [24:4.00]
 ; HASWELL-NEXT:    # kill: def %ecx killed %ecx def %rcx
 ; HASWELL-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pcmpestri:
 ; BROADWELL:       # %bb.0:
@@ -523,8 +523,8 @@
 ; HASWELL-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [19:4.00]
 ; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
 ; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
-; HASWELL-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [19:4.00]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [25:4.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pcmpestrm:
 ; BROADWELL:       # %bb.0:
@@ -614,10 +614,10 @@
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [11:3.00]
 ; HASWELL-NEXT:    movl %ecx, %eax # sched: [1:0.25]
-; HASWELL-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [11:3.00]
+; HASWELL-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [17:3.00]
 ; HASWELL-NEXT:    # kill: def %ecx killed %ecx def %rcx
 ; HASWELL-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pcmpistri:
 ; BROADWELL:       # %bb.0:
@@ -693,8 +693,8 @@
 ; HASWELL-LABEL: test_pcmpistrm:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [11:3.00]
-; HASWELL-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [11:3.00]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [17:3.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pcmpistrm:
 ; BROADWELL:       # %bb.0:
@@ -754,8 +754,8 @@
 ; HASWELL-LABEL: test_pcmpgtq:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [5:1.00]
-; HASWELL-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [5:1.00]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [11:1.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pcmpgtq:
 ; BROADWELL:       # %bb.0:
@@ -818,8 +818,8 @@
 ; HASWELL-LABEL: test_pclmulqdq:
 ; HASWELL:       # %bb.0:
 ; HASWELL-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [11:2.00]
-; HASWELL-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [11:2.00]
-; HASWELL-NEXT:    retq # sched: [2:1.00]
+; HASWELL-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [17:2.00]
+; HASWELL-NEXT:    retq # sched: [7:1.00]
 ;
 ; BROADWELL-LABEL: test_pclmulqdq:
 ; BROADWELL:       # %bb.0: