[llvm] r317785 - Sched model improving on btver2: JFPU01 resource, vtestp* for xmm.
Andrew V. Tischenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 06:19:59 PST 2017
Author: avt77
Date: Thu Nov 9 06:19:59 2017
New Revision: 317785
URL: http://llvm.org/viewvc/llvm-project?rev=317785&view=rev
Log:
Sched model improving on btver2: JFPU01 resource, vtestp* for xmm.
Differential Revision: https://reviews.llvm.org/D39802
Modified:
llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
llvm/trunk/test/CodeGen/X86/avx-schedule.ll
llvm/trunk/test/CodeGen/X86/sse41-schedule.ll
Modified: llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td?rev=317785&r1=317784&r2=317785&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td (original)
+++ llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td Thu Nov 9 06:19:59 2017
@@ -199,11 +199,13 @@ defm : JWriteResFpuPair<WriteCvtF2F,
def : WriteRes<WriteFVarBlend, [JFPU01]> {
let Latency = 2;
- let ResourceCycles = [2];
+ let ResourceCycles = [4];
+ let NumMicroOps = 3;
}
def : WriteRes<WriteFVarBlendLd, [JLAGU, JFPU01]> {
let Latency = 7;
- let ResourceCycles = [1, 2];
+ let ResourceCycles = [1, 4];
+ let NumMicroOps = 3;
}
// Vector integer operations.
@@ -217,21 +219,20 @@ defm : JWriteResFpuPair<WriteShuffle256,
def : WriteRes<WriteVarBlend, [JFPU01]> {
let Latency = 2;
- let ResourceCycles = [2];
+ let ResourceCycles = [4];
+ let NumMicroOps = 3;
}
def : WriteRes<WriteVarBlendLd, [JLAGU, JFPU01]> {
let Latency = 7;
- let ResourceCycles = [1, 2];
+ let ResourceCycles = [1, 4];
+ let NumMicroOps = 3;
}
// FIXME: why do we need to define AVX2 resource on CPU that doesn't have AVX2?
-def : WriteRes<WriteVarVecShift, [JFPU01]> {
- let Latency = 1;
- let ResourceCycles = [1];
-}
+def : WriteRes<WriteVarVecShift, [JFPU01]> {}
def : WriteRes<WriteVarVecShiftLd, [JLAGU, JFPU01]> {
let Latency = 6;
- let ResourceCycles = [1, 1];
+ let ResourceCycles = [1, 2];
}
def : WriteRes<WriteMPSAD, [JFPU0]> {
@@ -654,18 +655,32 @@ def : InstRW<[WriteVMOVMSK], (instregex
// and ALU0 in the integer unit is occupied instead.
def WriteVTESTY: SchedWriteRes<[JFPU01, JFPU0]> {
let Latency = 4;
- let ResourceCycles = [4, 2];
+ let ResourceCycles = [2, 2];
+ let NumMicroOps = 3;
}
def : InstRW<[WriteVTESTY], (instregex "VTESTP(S|D)Yrr")>;
def : InstRW<[WriteVTESTY], (instregex "VPTESTYrr")>;
def WriteVTESTYLd: SchedWriteRes<[JLAGU, JFPU01, JFPU0]> {
let Latency = 9;
- let ResourceCycles = [1, 4, 2];
+ let ResourceCycles = [1, 2, 2];
+ let NumMicroOps = 3;
}
def : InstRW<[WriteVTESTYLd], (instregex "VTESTP(S|D)Yrm")>;
def : InstRW<[WriteVTESTYLd], (instregex "VPTESTYrm")>;
+def WriteVTEST: SchedWriteRes<[JFPU0]> {
+ let Latency = 3;
+}
+def : InstRW<[WriteVTEST], (instregex "VTESTP(S|D)rr")>;
+def : InstRW<[WriteVTEST], (instregex "VPTESTrr")>;
+
+def WriteVTESTLd: SchedWriteRes<[JLAGU, JFPU0]> {
+ let Latency = 8;
+}
+def : InstRW<[WriteVTESTLd], (instregex "VTESTP(S|D)rm")>;
+def : InstRW<[WriteVTESTLd], (instregex "VPTESTrm")>;
+
def WriteVSQRTYPD: SchedWriteRes<[JFPU1]> {
let Latency = 54;
let ResourceCycles = [54];
Modified: llvm/trunk/test/CodeGen/X86/avx-schedule.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-schedule.ll?rev=317785&r1=317784&r2=317785&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx-schedule.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx-schedule.ll Thu Nov 9 06:19:59 2017
@@ -4611,9 +4611,9 @@ define i32 @test_testpd(<2 x double> %a0
; BTVER2-LABEL: test_testpd:
; BTVER2: # BB#0:
; BTVER2-NEXT: xorl %eax, %eax # sched: [1:0.50]
-; BTVER2-NEXT: vtestpd %xmm1, %xmm0 # sched: [1:0.50]
+; BTVER2-NEXT: vtestpd %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT: setb %al # sched: [1:0.50]
-; BTVER2-NEXT: vtestpd (%rdi), %xmm0 # sched: [6:1.00]
+; BTVER2-NEXT: vtestpd (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-NEXT: adcl $0, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -4697,9 +4697,9 @@ define i32 @test_testpd_ymm(<4 x double>
; BTVER2-LABEL: test_testpd_ymm:
; BTVER2: # BB#0:
; BTVER2-NEXT: xorl %eax, %eax # sched: [1:0.50]
-; BTVER2-NEXT: vtestpd %ymm1, %ymm0 # sched: [4:3.00]
+; BTVER2-NEXT: vtestpd %ymm1, %ymm0 # sched: [4:2.00]
; BTVER2-NEXT: setb %al # sched: [1:0.50]
-; BTVER2-NEXT: vtestpd (%rdi), %ymm0 # sched: [9:3.00]
+; BTVER2-NEXT: vtestpd (%rdi), %ymm0 # sched: [9:2.00]
; BTVER2-NEXT: adcl $0, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -4778,9 +4778,9 @@ define i32 @test_testps(<4 x float> %a0,
; BTVER2-LABEL: test_testps:
; BTVER2: # BB#0:
; BTVER2-NEXT: xorl %eax, %eax # sched: [1:0.50]
-; BTVER2-NEXT: vtestps %xmm1, %xmm0 # sched: [1:0.50]
+; BTVER2-NEXT: vtestps %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT: setb %al # sched: [1:0.50]
-; BTVER2-NEXT: vtestps (%rdi), %xmm0 # sched: [6:1.00]
+; BTVER2-NEXT: vtestps (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-NEXT: adcl $0, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -4864,9 +4864,9 @@ define i32 @test_testps_ymm(<8 x float>
; BTVER2-LABEL: test_testps_ymm:
; BTVER2: # BB#0:
; BTVER2-NEXT: xorl %eax, %eax # sched: [1:0.50]
-; BTVER2-NEXT: vtestps %ymm1, %ymm0 # sched: [4:3.00]
+; BTVER2-NEXT: vtestps %ymm1, %ymm0 # sched: [4:2.00]
; BTVER2-NEXT: setb %al # sched: [1:0.50]
-; BTVER2-NEXT: vtestps (%rdi), %ymm0 # sched: [9:3.00]
+; BTVER2-NEXT: vtestps (%rdi), %ymm0 # sched: [9:2.00]
; BTVER2-NEXT: adcl $0, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
Modified: llvm/trunk/test/CodeGen/X86/sse41-schedule.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse41-schedule.ll?rev=317785&r1=317784&r2=317785&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sse41-schedule.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sse41-schedule.ll Thu Nov 9 06:19:59 2017
@@ -192,8 +192,8 @@ define <2 x double> @test_blendvpd(<2 x
;
; BTVER2-LABEL: test_blendvpd:
; BTVER2: # BB#0:
-; BTVER2-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:1.00]
-; BTVER2-NEXT: vblendvpd %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:1.00]
+; BTVER2-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:2.00]
+; BTVER2-NEXT: vblendvpd %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:2.00]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_blendvpd:
@@ -259,8 +259,8 @@ define <4 x float> @test_blendvps(<4 x f
;
; BTVER2-LABEL: test_blendvps:
; BTVER2: # BB#0:
-; BTVER2-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:1.00]
-; BTVER2-NEXT: vblendvps %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:1.00]
+; BTVER2-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:2.00]
+; BTVER2-NEXT: vblendvps %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:2.00]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_blendvps:
@@ -745,8 +745,8 @@ define <16 x i8> @test_pblendvb(<16 x i8
;
; BTVER2-LABEL: test_pblendvb:
; BTVER2: # BB#0:
-; BTVER2-NEXT: vpblendvb %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:1.00]
-; BTVER2-NEXT: vpblendvb %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:1.00]
+; BTVER2-NEXT: vpblendvb %xmm2, %xmm1, %xmm0, %xmm0 # sched: [2:2.00]
+; BTVER2-NEXT: vpblendvb %xmm2, (%rdi), %xmm0, %xmm0 # sched: [7:2.00]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pblendvb:
@@ -2935,9 +2935,9 @@ define i32 @test_ptest(<2 x i64> %a0, <2
;
; BTVER2-LABEL: test_ptest:
; BTVER2: # BB#0:
-; BTVER2-NEXT: vptest %xmm1, %xmm0 # sched: [1:0.50]
+; BTVER2-NEXT: vptest %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT: setb %al # sched: [1:0.50]
-; BTVER2-NEXT: vptest (%rdi), %xmm0 # sched: [6:1.00]
+; BTVER2-NEXT: vptest (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-NEXT: setb %cl # sched: [1:0.50]
; BTVER2-NEXT: andb %al, %cl # sched: [1:0.50]
; BTVER2-NEXT: movzbl %cl, %eax # sched: [1:0.50]
More information about the llvm-commits
mailing list