[llvm] r328497 - [X86][Btver2] Add (V)SQRTPD/(V)SQRTSD costs

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 07:03:40 PDT 2018


Author: rksimon
Date: Mon Mar 26 07:03:40 2018
New Revision: 328497

URL: http://llvm.org/viewvc/llvm-project?rev=328497&view=rev
Log:
[X86][Btver2] Add (V)SQRTPD/(V)SQRTSD costs

The xmm sd/pd versions were using the WriteFSQRT default which is modelled on sqrtss/sqrtps

Modified:
    llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
    llvm/trunk/test/CodeGen/X86/sse2-schedule.ll
    llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s
    llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s

Modified: llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td?rev=328497&r1=328496&r2=328497&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td (original)
+++ llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td Mon Mar 26 07:03:40 2018
@@ -789,6 +789,22 @@ def JWriteVTESTLd: SchedWriteRes<[JLAGU,
 }
 def : InstRW<[JWriteVTESTLd], (instrs PTESTrm, VPTESTrm, VTESTPDrm, VTESTPSrm)>;
 
+def JWriteVSQRTPD: SchedWriteRes<[JFPU1, JFPM]> {
+  let Latency = 27;
+  let ResourceCycles = [1, 27];
+}
+def : InstRW<[JWriteVSQRTPD], (instrs SQRTPDr, VSQRTPDr,
+                                      SQRTSDr, VSQRTSDr,
+                                      SQRTSDr_Int, VSQRTSDr_Int)>;
+
+def JWriteVSQRTPDLd: SchedWriteRes<[JLAGU, JFPU1, JFPM]> {
+  let Latency = 32;
+  let ResourceCycles = [1, 1, 27];
+}
+def : InstRW<[JWriteVSQRTPDLd], (instrs SQRTPDm, VSQRTPDm,
+                                        SQRTSDm, VSQRTSDm,
+                                        SQRTSDm_Int, VSQRTSDm_Int)>;
+
 def JWriteVSQRTYPD: SchedWriteRes<[JFPU1, JFPM]> {
   let Latency = 54;
   let ResourceCycles = [2, 54];

Modified: llvm/trunk/test/CodeGen/X86/sse2-schedule.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse2-schedule.ll?rev=328497&r1=328496&r2=328497&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sse2-schedule.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sse2-schedule.ll Mon Mar 26 07:03:40 2018
@@ -14234,15 +14234,15 @@ define <2 x double> @test_sqrtpd(<2 x do
 ;
 ; BTVER2-SSE-LABEL: test_sqrtpd:
 ; BTVER2-SSE:       # %bb.0:
-; BTVER2-SSE-NEXT:    sqrtpd %xmm0, %xmm1 # sched: [21:21.00]
-; BTVER2-SSE-NEXT:    sqrtpd (%rdi), %xmm0 # sched: [26:21.00]
+; BTVER2-SSE-NEXT:    sqrtpd %xmm0, %xmm1 # sched: [27:27.00]
+; BTVER2-SSE-NEXT:    sqrtpd (%rdi), %xmm0 # sched: [32:27.00]
 ; BTVER2-SSE-NEXT:    addpd %xmm1, %xmm0 # sched: [3:1.00]
 ; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
 ;
 ; BTVER2-LABEL: test_sqrtpd:
 ; BTVER2:       # %bb.0:
-; BTVER2-NEXT:    vsqrtpd (%rdi), %xmm1 # sched: [26:21.00]
-; BTVER2-NEXT:    vsqrtpd %xmm0, %xmm0 # sched: [21:21.00]
+; BTVER2-NEXT:    vsqrtpd (%rdi), %xmm1 # sched: [32:27.00]
+; BTVER2-NEXT:    vsqrtpd %xmm0, %xmm0 # sched: [27:27.00]
 ; BTVER2-NEXT:    vaddpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
 ; BTVER2-NEXT:    retq # sched: [4:1.00]
 ;
@@ -14377,16 +14377,16 @@ define <2 x double> @test_sqrtsd(<2 x do
 ; BTVER2-SSE-LABEL: test_sqrtsd:
 ; BTVER2-SSE:       # %bb.0:
 ; BTVER2-SSE-NEXT:    movapd (%rdi), %xmm1 # sched: [5:1.00]
-; BTVER2-SSE-NEXT:    sqrtsd %xmm0, %xmm0 # sched: [21:21.00]
-; BTVER2-SSE-NEXT:    sqrtsd %xmm1, %xmm1 # sched: [21:21.00]
+; BTVER2-SSE-NEXT:    sqrtsd %xmm0, %xmm0 # sched: [27:27.00]
+; BTVER2-SSE-NEXT:    sqrtsd %xmm1, %xmm1 # sched: [27:27.00]
 ; BTVER2-SSE-NEXT:    addpd %xmm1, %xmm0 # sched: [3:1.00]
 ; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
 ;
 ; BTVER2-LABEL: test_sqrtsd:
 ; BTVER2:       # %bb.0:
 ; BTVER2-NEXT:    vmovapd (%rdi), %xmm1 # sched: [5:1.00]
-; BTVER2-NEXT:    vsqrtsd %xmm0, %xmm0, %xmm0 # sched: [21:21.00]
-; BTVER2-NEXT:    vsqrtsd %xmm1, %xmm1, %xmm1 # sched: [21:21.00]
+; BTVER2-NEXT:    vsqrtsd %xmm0, %xmm0, %xmm0 # sched: [27:27.00]
+; BTVER2-NEXT:    vsqrtsd %xmm1, %xmm1, %xmm1 # sched: [27:27.00]
 ; BTVER2-NEXT:    vaddpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
 ; BTVER2-NEXT:    retq # sched: [4:1.00]
 ;

Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s?rev=328497&r1=328496&r2=328497&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s Mon Mar 26 07:03:40 2018
@@ -1637,16 +1637,16 @@ vzeroupper
 # CHECK-NEXT:  -      -      -     0.50   0.50   0.50   0.50   1.00    -      -      -      -      -      -     	vshufps	$1, (%rax), %xmm1, %xmm2
 # CHECK-NEXT:  -      -      -     1.00   1.00   1.00   1.00    -      -      -      -      -      -      -     	vshufps	$1, %ymm0, %ymm1, %ymm2
 # CHECK-NEXT:  -      -      -     1.00   1.00   1.00   1.00   2.00    -      -      -      -      -      -     	vshufps	$1, (%rax), %ymm1, %ymm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	vsqrtpd	%xmm0, %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtpd	(%rax), %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00    -      -      -      -      -      -      -     	vsqrtpd	%xmm0, %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtpd	(%rax), %xmm2
 # CHECK-NEXT:  -      -      -      -     54.00   -     2.00    -      -      -      -      -      -      -     	vsqrtpd	%ymm0, %ymm2
 # CHECK-NEXT:  -      -      -      -     54.00   -     2.00   2.00    -      -      -      -      -      -     	vsqrtpd	(%rax), %ymm2
 # CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	vsqrtps	%xmm0, %xmm2
 # CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtps	(%rax), %xmm2
 # CHECK-NEXT:  -      -      -      -     42.00   -     2.00    -      -      -      -      -      -      -     	vsqrtps	%ymm0, %ymm2
 # CHECK-NEXT:  -      -      -      -     42.00   -     2.00   2.00    -      -      -      -      -      -     	vsqrtps	(%rax), %ymm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	vsqrtsd	%xmm0, %xmm1, %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtsd	(%rax), %xmm1, %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00    -      -      -      -      -      -      -     	vsqrtsd	%xmm0, %xmm1, %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtsd	(%rax), %xmm1, %xmm2
 # CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	vsqrtss	%xmm0, %xmm1, %xmm2
 # CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	vsqrtss	(%rax), %xmm1, %xmm2
 # CHECK-NEXT:  -      -      -      -      -      -      -      -      -     1.00    -      -      -      -     	vstmxcsr	(%rax)

Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s?rev=328497&r1=328496&r2=328497&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s Mon Mar 26 07:03:40 2018
@@ -632,10 +632,10 @@ xorpd       (%rax), %xmm2
 # CHECK-NEXT:  -      -      -      -      -     0.50   0.50   1.00    -      -      -     0.50   0.50    -     	pxor	(%rax), %xmm2
 # CHECK-NEXT:  -      -      -     0.50   0.50   0.50   0.50    -      -      -      -      -      -      -     	shufpd	$1, %xmm0, %xmm2
 # CHECK-NEXT:  -      -      -     0.50   0.50   0.50   0.50   1.00    -      -      -      -      -      -     	shufpd	$1, (%rax), %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	sqrtpd	%xmm0, %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	sqrtpd	(%rax), %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00    -      -      -      -      -      -      -     	sqrtsd	%xmm0, %xmm2
-# CHECK-NEXT:  -      -      -      -     21.00   -     1.00   1.00    -      -      -      -      -      -     	sqrtsd	(%rax), %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00    -      -      -      -      -      -      -     	sqrtpd	%xmm0, %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00   1.00    -      -      -      -      -      -     	sqrtpd	(%rax), %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00    -      -      -      -      -      -      -     	sqrtsd	%xmm0, %xmm2
+# CHECK-NEXT:  -      -      -      -     27.00   -     1.00   1.00    -      -      -      -      -      -     	sqrtsd	(%rax), %xmm2
 # CHECK-NEXT:  -      -      -     1.00    -     1.00    -      -      -      -      -      -      -      -     	subpd	%xmm0, %xmm2
 # CHECK-NEXT:  -      -      -     1.00    -     1.00    -     1.00    -      -      -      -      -      -     	subpd	(%rax), %xmm2
 # CHECK-NEXT:  -      -      -     1.00    -     1.00    -      -      -      -      -      -      -      -     	subsd	%xmm0, %xmm2




More information about the llvm-commits mailing list