[llvm] r344600 - [X86] Fix Skylake ReadAfterLd for PADDrm etc.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 16 02:50:16 PDT 2018


Author: rksimon
Date: Tue Oct 16 02:50:16 2018
New Revision: 344600

URL: http://llvm.org/viewvc/llvm-project?rev=344600&view=rev
Log:
[X86] Fix Skylake ReadAfterLd for PADDrm etc.

Missed in rL343868 as due to their custom InstrRW.

Modified:
    llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td
    llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td
    llvm/trunk/test/tools/llvm-mca/X86/read-after-ld-2.s

Modified: llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td?rev=344600&r1=344599&r2=344600&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td (original)
+++ llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td Tue Oct 16 02:50:16 2018
@@ -1133,7 +1133,8 @@ def SKLWriteResGroup91 : SchedWriteRes<[
 def: InstRW<[SKLWriteResGroup91], (instrs VINSERTF128rm,
                                           VINSERTI128rm,
                                           VPBLENDDrmi)>;
-def: InstRW<[SKLWriteResGroup91], (instregex "(V?)PADD(B|D|Q|W)rm",
+def: InstRW<[SKLWriteResGroup91, ReadAfterVecXLd],
+                                  (instregex "(V?)PADD(B|D|Q|W)rm",
                                              "(V?)PSUB(B|D|Q|W)rm")>;
 
 def SKLWriteResGroup92 : SchedWriteRes<[SKLPort5,SKLPort23]> {
@@ -1230,7 +1231,8 @@ def SKLWriteResGroup110 : SchedWriteRes<
   let ResourceCycles = [1,1];
 }
 def: InstRW<[SKLWriteResGroup110], (instrs VPBLENDDYrmi)>;
-def: InstRW<[SKLWriteResGroup110], (instregex "VPADD(B|D|Q|W)Yrm",
+def: InstRW<[SKLWriteResGroup110, ReadAfterVecYLd],
+                                   (instregex "VPADD(B|D|Q|W)Yrm",
                                               "VPSUB(B|D|Q|W)Yrm")>;
 
 def SKLWriteResGroup112 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> {

Modified: llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td?rev=344600&r1=344599&r2=344600&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td (original)
+++ llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td Tue Oct 16 02:50:16 2018
@@ -1339,7 +1339,8 @@ def SKXWriteResGroup95 : SchedWriteRes<[
 }
 def: InstRW<[SKXWriteResGroup95], (instrs VMOVNTDQAZ128rm,
                                           VPBLENDDrmi)>;
-def: InstRW<[SKXWriteResGroup95], (instregex "VBLENDMPDZ128rm(b?)",
+def: InstRW<[SKXWriteResGroup95, ReadAfterVecXLd],
+                                  (instregex "VBLENDMPDZ128rm(b?)",
                                              "VBLENDMPSZ128rm(b?)",
                                              "VBROADCASTI32X2Z128m(b?)",
                                              "VBROADCASTSSZ128m(b?)",
@@ -1534,7 +1535,8 @@ def SKXWriteResGroup121 : SchedWriteRes<
 }
 def: InstRW<[SKXWriteResGroup121], (instrs VMOVNTDQAZ256rm,
                                            VPBLENDDYrmi)>;
-def: InstRW<[SKXWriteResGroup121], (instregex "VBLENDMPD(Z|Z256)rm(b?)",
+def: InstRW<[SKXWriteResGroup121, ReadAfterVecYLd],
+                                   (instregex "VBLENDMPD(Z|Z256)rm(b?)",
                                               "VBLENDMPS(Z|Z256)rm(b?)",
                                               "VBROADCASTF32X2Z256m(b?)",
                                               "VBROADCASTF32X2Zm(b?)",

Modified: llvm/trunk/test/tools/llvm-mca/X86/read-after-ld-2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/read-after-ld-2.s?rev=344600&r1=344599&r2=344600&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/read-after-ld-2.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/read-after-ld-2.s Tue Oct 16 02:50:16 2018
@@ -23,7 +23,7 @@ cmp     %edi, %edx
 # HASWELL-NEXT: Total Cycles:      143
 # HASWELL-NEXT: Total uOps:        500
 
-# SKYLAKE-NEXT: Total Cycles:      803
+# SKYLAKE-NEXT: Total Cycles:      110
 # SKYLAKE-NEXT: Total uOps:        500
 
 # ZNVER1-NEXT:  Total Cycles:      110
@@ -40,8 +40,8 @@ cmp     %edi, %edx
 # HASWELL-NEXT: Block RThroughput: 1.3
 
 # SKYLAKE:      Dispatch Width:    6
-# SKYLAKE-NEXT: uOps Per Cycle:    0.62
-# SKYLAKE-NEXT: IPC:               0.50
+# SKYLAKE-NEXT: uOps Per Cycle:    4.55
+# SKYLAKE-NEXT: IPC:               3.64
 # SKYLAKE-NEXT: Block RThroughput: 0.8
 
 # ZNVER1:       Dispatch Width:    4
@@ -57,8 +57,8 @@ cmp     %edi, %edx
 # HASWELL-NEXT:                     0123456789
 # HASWELL-NEXT: Index     0123456789          012
 
-# SKYLAKE-NEXT:                     0123456789          0123456789          0123456789          01234
-# SKYLAKE-NEXT: Index     0123456789          0123456789          0123456789          0123456789
+# SKYLAKE-NEXT:                     0123456789
+# SKYLAKE-NEXT: Index     0123456789
 
 # ZNVER1-NEXT:                      0123456789
 # ZNVER1-NEXT:  Index     0123456789
@@ -145,43 +145,46 @@ cmp     %edi, %edx
 # HASWELL-NEXT: [9,2]     .    .    . DeE-------R   addq	$32, %r8
 # HASWELL-NEXT: [9,3]     .    .    .  DeE------R   cmpl	%edi, %edx
 
-# SKYLAKE:      [0,0]     DeER .    .    .    .    .    .    .    .    .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [0,1]     DeeeeeeeeER    .    .    .    .    .    .    .    .    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [0,2]     DeE-------R    .    .    .    .    .    .    .    .    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [0,3]     D=eE------R    .    .    .    .    .    .    .    .    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [1,0]     D=eE------R    .    .    .    .    .    .    .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [1,1]     .D=======eeeeeeeeER .    .    .    .    .    .    .    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [1,2]     .DeE--------------R .    .    .    .    .    .    .    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [1,3]     .D=eE-------------R .    .    .    .    .    .    .    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [2,0]     .D=eE-------------R .    .    .    .    .    .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [2,1]     . D==============eeeeeeeeER   .    .    .    .    .    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [2,2]     . DeE---------------------R   .    .    .    .    .    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [2,3]     . D=eE--------------------R   .    .    .    .    .    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [3,0]     . D=eE--------------------R   .    .    .    .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [3,1]     .  D=====================eeeeeeeeER.    .    .    .    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [3,2]     .  DeE----------------------------R.    .    .    .    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [3,3]     .  D=eE---------------------------R.    .    .    .    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [4,0]     .  D=eE---------------------------R.    .    .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [4,1]     .   D============================eeeeeeeeER  .    .    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [4,2]     .   DeE-----------------------------------R  .    .    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [4,3]     .   D=eE----------------------------------R  .    .    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [5,0]     .   D=eE----------------------------------R  .    .    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [5,1]     .    D===================================eeeeeeeeER    .    .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [5,2]     .    DeE------------------------------------------R    .    .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [5,3]     .    D=eE-----------------------------------------R    .    .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [6,0]     .    D=eE-----------------------------------------R    .    .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [6,1]     .    .D==========================================eeeeeeeeER .    .    .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [6,2]     .    .DeE-------------------------------------------------R .    .    .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [6,3]     .    .D=eE------------------------------------------------R .    .    .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [7,0]     .    .D=eE------------------------------------------------R .    .    .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [7,1]     .    . D=================================================eeeeeeeeER   .   .   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [7,2]     .    . DeE--------------------------------------------------------R   .   .   addq	$32, %r8
-# SKYLAKE-NEXT: [7,3]     .    . D=eE-------------------------------------------------------R   .   .   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [8,0]     .    . D=eE-------------------------------------------------------R   .   .   addl	$1, %edx
-# SKYLAKE-NEXT: [8,1]     .    .  D========================================================eeeeeeeeER   vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: [8,2]     .    .  DeE---------------------------------------------------------------R   addq	$32, %r8
-# SKYLAKE-NEXT: [8,3]     .    .  D=eE--------------------------------------------------------------R   cmpl	%edi, %edx
-# SKYLAKE-NEXT: [9,0]     .    .  D=eE--------------------------------------------------------------R   addl	$1, %edx
+# SKYLAKE:      [0,0]     DeER .    .    .   .   addl	$1, %edx
+# SKYLAKE-NEXT: [0,1]     DeeeeeeeeER    .   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [0,2]     DeE-------R    .   .   addq	$32, %r8
+# SKYLAKE-NEXT: [0,3]     D=eE------R    .   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [1,0]     D=eE------R    .   .   addl	$1, %edx
+# SKYLAKE-NEXT: [1,1]     .DeeeeeeeeER   .   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [1,2]     .DeE-------R   .   .   addq	$32, %r8
+# SKYLAKE-NEXT: [1,3]     .D=eE------R   .   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [2,0]     .D=eE------R   .   .   addl	$1, %edx
+# SKYLAKE-NEXT: [2,1]     . DeeeeeeeeER  .   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [2,2]     . DeE-------R  .   .   addq	$32, %r8
+# SKYLAKE-NEXT: [2,3]     . D=eE------R  .   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [3,0]     . D=eE------R  .   .   addl	$1, %edx
+# SKYLAKE-NEXT: [3,1]     .  DeeeeeeeeER .   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [3,2]     .  DeE-------R .   .   addq	$32, %r8
+# SKYLAKE-NEXT: [3,3]     .  D=eE------R .   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [4,0]     .  D=eE------R .   .   addl	$1, %edx
+# SKYLAKE-NEXT: [4,1]     .   DeeeeeeeeER.   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [4,2]     .   DeE-------R.   .   addq	$32, %r8
+# SKYLAKE-NEXT: [4,3]     .   D=eE------R.   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [5,0]     .   D=eE------R.   .   addl	$1, %edx
+# SKYLAKE-NEXT: [5,1]     .    DeeeeeeeeER   .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [5,2]     .    DeE-------R   .   addq	$32, %r8
+# SKYLAKE-NEXT: [5,3]     .    D=eE------R   .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [6,0]     .    D=eE------R   .   addl	$1, %edx
+# SKYLAKE-NEXT: [6,1]     .    .DeeeeeeeeER  .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [6,2]     .    .DeE-------R  .   addq	$32, %r8
+# SKYLAKE-NEXT: [6,3]     .    .D=eE------R  .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [7,0]     .    .D=eE------R  .   addl	$1, %edx
+# SKYLAKE-NEXT: [7,1]     .    . DeeeeeeeeER .   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [7,2]     .    . DeE-------R .   addq	$32, %r8
+# SKYLAKE-NEXT: [7,3]     .    . D=eE------R .   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [8,0]     .    . D=eE------R .   addl	$1, %edx
+# SKYLAKE-NEXT: [8,1]     .    .  DeeeeeeeeER.   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [8,2]     .    .  DeE-------R.   addq	$32, %r8
+# SKYLAKE-NEXT: [8,3]     .    .  D=eE------R.   cmpl	%edi, %edx
+# SKYLAKE-NEXT: [9,0]     .    .  D=eE------R.   addl	$1, %edx
+# SKYLAKE-NEXT: [9,1]     .    .   DeeeeeeeeER   vpaddd	(%r8), %ymm0, %ymm0
+# SKYLAKE-NEXT: [9,2]     .    .   DeE-------R   addq	$32, %r8
+# SKYLAKE-NEXT: [9,3]     .    .   D=eE------R   cmpl	%edi, %edx
 
 # ZNVER1:       [0,0]     DeER .    .    .   .   addl	$1, %edx
 # ZNVER1-NEXT:  [0,1]     DeeeeeeeeER    .   .   vpaddd	(%r8), %ymm0, %ymm0
@@ -233,21 +236,20 @@ cmp     %edi, %edx
 # ALL:                [0]    [1]    [2]    [3]
 
 # BDWELL-NEXT:  0.     10    1.0    0.4    4.5       addl	$1, %edx
-# BDWELL-NEXT:  1.     10    1.0    0.1    0.0       vpaddd	(%r8), %ymm0, %ymm0
+# HASWELL-NEXT: 0.     10    1.0    0.4    5.4       addl	$1, %edx
+# SKYLAKE-NEXT: 0.     10    1.9    0.1    5.4       addl	$1, %edx
+# ZNVER1-NEXT:  0.     10    1.0    0.1    5.4       addl	$1, %edx
+
+# ALL-NEXT:     1.     10    1.0    0.1    0.0       vpaddd	(%r8), %ymm0, %ymm0
+
 # BDWELL-NEXT:  2.     10    1.0    0.4    5.7       addq	$32, %r8
 # BDWELL-NEXT:  3.     10    1.0    0.0    5.3       cmpl	%edi, %edx
 
-# HASWELL-NEXT: 0.     10    1.0    0.4    5.4       addl	$1, %edx
-# HASWELL-NEXT: 1.     10    1.0    0.1    0.0       vpaddd	(%r8), %ymm0, %ymm0
 # HASWELL-NEXT: 2.     10    1.0    0.4    6.7       addq	$32, %r8
 # HASWELL-NEXT: 3.     10    1.0    0.0    6.3       cmpl	%edi, %edx
 
-# SKYLAKE-NEXT: 0.     10    1.9    0.1    30.6      addl	$1, %edx
-# SKYLAKE-NEXT: 1.     10    32.5   0.1    0.0       vpaddd	(%r8), %ymm0, %ymm0
-# SKYLAKE-NEXT: 2.     10    1.0    0.1    38.5      addq	$32, %r8
-# SKYLAKE-NEXT: 3.     10    2.0    0.0    37.5      cmpl	%edi, %edx
+# SKYLAKE-NEXT: 2.     10    1.0    0.1    7.0       addq	$32, %r8
+# SKYLAKE-NEXT: 3.     10    2.0    0.0    6.0       cmpl	%edi, %edx
 
-# ZNVER1-NEXT:  0.     10    1.0    0.1    5.4       addl	$1, %edx
-# ZNVER1-NEXT:  1.     10    1.0    0.1    0.0       vpaddd	(%r8), %ymm0, %ymm0
 # ZNVER1-NEXT:  2.     10    1.0    0.1    7.0       addq	$32, %r8
 # ZNVER1-NEXT:  3.     10    2.0    0.0    6.0       cmpl	%edi, %edx




More information about the llvm-commits mailing list