[llvm] dade83c - [X86][SLM] Fix ADDQ/SUBQ/CMPEQQ throughput to account for running on either port.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 24 02:08:54 PDT 2021
Author: Simon Pilgrim
Date: 2021-09-24T10:06:14+01:00
New Revision: dade83c02a11401897bcdb8c255db69b5c366e95
URL: https://github.com/llvm/llvm-project/commit/dade83c02a11401897bcdb8c255db69b5c366e95
DIFF: https://github.com/llvm/llvm-project/commit/dade83c02a11401897bcdb8c255db69b5c366e95.diff
LOG: [X86][SLM] Fix ADDQ/SUBQ/CMPEQQ throughput to account for running on either port.
Testing on a SLM box suggests these can run on either port, but the throughput is 4cy on either (inc MMX versions). Confirmed with Intel AoM / Agner / InstLatX64.
Added:
Modified:
llvm/lib/Target/X86/X86ScheduleSLM.td
llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ScheduleSLM.td b/llvm/lib/Target/X86/X86ScheduleSLM.td
index b0a2c75801c74..158c38aa4e49e 100644
--- a/llvm/lib/Target/X86/X86ScheduleSLM.td
+++ b/llvm/lib/Target/X86/X86ScheduleSLM.td
@@ -465,15 +465,19 @@ def : WriteRes<WriteNop, []>;
def SLMWriteResGroup1rr : SchedWriteRes<[SLM_FPC_RSV01]> {
let Latency = 4;
let NumMicroOps = 2;
- let ResourceCycles = [4];
+ let ResourceCycles = [8];
}
-def: InstRW<[SLMWriteResGroup1rr], (instrs PADDQrr, PSUBQrr, PCMPEQQrr)>;
+def: InstRW<[SLMWriteResGroup1rr], (instrs MMX_PADDQirr, PADDQrr,
+ MMX_PSUBQirr, PSUBQrr,
+ PCMPEQQrr)>;
def SLMWriteResGroup1rm : SchedWriteRes<[SLM_MEC_RSV,SLM_FPC_RSV01]> {
let Latency = 7;
let NumMicroOps = 3;
- let ResourceCycles = [1,4];
+ let ResourceCycles = [1,8];
}
-def: InstRW<[SLMWriteResGroup1rm], (instrs PADDQrm, PSUBQrm, PCMPEQQrm)>;
+def: InstRW<[SLMWriteResGroup1rm], (instrs MMX_PADDQirm, PADDQrm,
+ MMX_PSUBQirm, PSUBQrm,
+ PCMPEQQrm)>;
} // SchedModel
diff --git a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
index 6c88d2bdc977f..d1282864230b7 100644
--- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
+++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
@@ -526,10 +526,10 @@ xorpd (%rax), %xmm2
# CHECK-NEXT: 1 4 1.00 * paddb (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 paddd %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * paddd (%rax), %xmm2
-# CHECK-NEXT: 1 1 0.50 paddq %mm0, %mm2
-# CHECK-NEXT: 1 4 1.00 * paddq (%rax), %mm2
-# CHECK-NEXT: 2 4 2.00 paddq %xmm0, %xmm2
-# CHECK-NEXT: 3 7 2.00 * paddq (%rax), %xmm2
+# CHECK-NEXT: 2 4 4.00 paddq %mm0, %mm2
+# CHECK-NEXT: 3 7 4.00 * paddq (%rax), %mm2
+# CHECK-NEXT: 2 4 4.00 paddq %xmm0, %xmm2
+# CHECK-NEXT: 3 7 4.00 * paddq (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 paddsb %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * paddsb (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 paddsw %xmm0, %xmm2
@@ -624,10 +624,10 @@ xorpd (%rax), %xmm2
# CHECK-NEXT: 1 4 1.00 * psubb (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 psubd %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * psubd (%rax), %xmm2
-# CHECK-NEXT: 1 1 0.50 psubq %mm0, %mm2
-# CHECK-NEXT: 1 4 1.00 * psubq (%rax), %mm2
-# CHECK-NEXT: 2 4 2.00 psubq %xmm0, %xmm2
-# CHECK-NEXT: 3 7 2.00 * psubq (%rax), %xmm2
+# CHECK-NEXT: 2 4 4.00 psubq %mm0, %mm2
+# CHECK-NEXT: 3 7 4.00 * psubq (%rax), %mm2
+# CHECK-NEXT: 2 4 4.00 psubq %xmm0, %xmm2
+# CHECK-NEXT: 3 7 4.00 * psubq (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 psubsb %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * psubsb (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 psubsw %xmm0, %xmm2
@@ -687,7 +687,7 @@ xorpd (%rax), %xmm2
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7]
-# CHECK-NEXT: - 412.00 12.00 235.50 77.50 3.00 3.00 134.00
+# CHECK-NEXT: - 412.00 12.00 257.50 99.50 3.00 3.00 134.00
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions:
@@ -810,10 +810,10 @@ xorpd (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 paddb (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - paddd %xmm0, %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 paddd (%rax), %xmm2
-# CHECK-NEXT: - - - 0.50 0.50 - - - paddq %mm0, %mm2
-# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 paddq (%rax), %mm2
-# CHECK-NEXT: - - - 2.00 2.00 - - - paddq %xmm0, %xmm2
-# CHECK-NEXT: - - - 2.00 2.00 - - 1.00 paddq (%rax), %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - - paddq %mm0, %mm2
+# CHECK-NEXT: - - - 4.00 4.00 - - 1.00 paddq (%rax), %mm2
+# CHECK-NEXT: - - - 4.00 4.00 - - - paddq %xmm0, %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - 1.00 paddq (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - paddsb %xmm0, %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 paddsb (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - paddsw %xmm0, %xmm2
@@ -908,10 +908,10 @@ xorpd (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 psubb (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - psubd %xmm0, %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 psubd (%rax), %xmm2
-# CHECK-NEXT: - - - 0.50 0.50 - - - psubq %mm0, %mm2
-# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 psubq (%rax), %mm2
-# CHECK-NEXT: - - - 2.00 2.00 - - - psubq %xmm0, %xmm2
-# CHECK-NEXT: - - - 2.00 2.00 - - 1.00 psubq (%rax), %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - - psubq %mm0, %mm2
+# CHECK-NEXT: - - - 4.00 4.00 - - 1.00 psubq (%rax), %mm2
+# CHECK-NEXT: - - - 4.00 4.00 - - - psubq %xmm0, %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - 1.00 psubq (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - psubsb %xmm0, %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - 1.00 psubsb (%rax), %xmm2
# CHECK-NEXT: - - - 0.50 0.50 - - - psubsw %xmm0, %xmm2
diff --git a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
index 3779e5a7895bc..215e46eb5ab6d 100644
--- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
+++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
@@ -180,8 +180,8 @@ roundss $1, (%rax), %xmm2
# CHECK-NEXT: 3 7 4.00 * pblendvb %xmm0, (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 pblendw $11, %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * pblendw $11, (%rax), %xmm2
-# CHECK-NEXT: 2 4 2.00 pcmpeqq %xmm0, %xmm2
-# CHECK-NEXT: 3 7 2.00 * pcmpeqq (%rax), %xmm2
+# CHECK-NEXT: 2 4 4.00 pcmpeqq %xmm0, %xmm2
+# CHECK-NEXT: 3 7 4.00 * pcmpeqq (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 pextrb $1, %xmm0, %ecx
# CHECK-NEXT: 2 4 2.00 * pextrb $1, %xmm0, (%rax)
# CHECK-NEXT: 1 1 1.00 pextrd $1, %xmm0, %ecx
@@ -264,7 +264,7 @@ roundss $1, (%rax), %xmm2
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7]
-# CHECK-NEXT: - - - 104.00 61.00 - - 54.00
+# CHECK-NEXT: - - - 108.00 65.00 - - 54.00
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions:
@@ -293,8 +293,8 @@ roundss $1, (%rax), %xmm2
# CHECK-NEXT: - - - 4.00 - - - 1.00 pblendvb %xmm0, (%rax), %xmm2
# CHECK-NEXT: - - - 1.00 - - - - pblendw $11, %xmm0, %xmm2
# CHECK-NEXT: - - - 1.00 - - - 1.00 pblendw $11, (%rax), %xmm2
-# CHECK-NEXT: - - - 2.00 2.00 - - - pcmpeqq %xmm0, %xmm2
-# CHECK-NEXT: - - - 2.00 2.00 - - 1.00 pcmpeqq (%rax), %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - - pcmpeqq %xmm0, %xmm2
+# CHECK-NEXT: - - - 4.00 4.00 - - 1.00 pcmpeqq (%rax), %xmm2
# CHECK-NEXT: - - - 1.00 - - - - pextrb $1, %xmm0, %ecx
# CHECK-NEXT: - - - 1.00 - - - 2.00 pextrb $1, %xmm0, (%rax)
# CHECK-NEXT: - - - 1.00 - - - - pextrd $1, %xmm0, %ecx
More information about the llvm-commits
mailing list