[llvm] 2285ba9 - [X86] Fix uops counts for SLM extract/extract-store instructions
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 08:16:57 PST 2022
Author: Simon Pilgrim
Date: 2022-11-27T16:16:36Z
New Revision: 2285ba9acca44da4ce73a37427550a05f8e98901
URL: https://github.com/llvm/llvm-project/commit/2285ba9acca44da4ce73a37427550a05f8e98901
DIFF: https://github.com/llvm/llvm-project/commit/2285ba9acca44da4ce73a37427550a05f8e98901.diff
LOG: [X86] Fix uops counts for SLM extract/extract-store instructions
Matches Intel AoM + Agner
Added:
Modified:
llvm/lib/Target/X86/X86ScheduleSLM.td
llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s
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 598e56746d892..902591471491b 100644
--- a/llvm/lib/Target/X86/X86ScheduleSLM.td
+++ b/llvm/lib/Target/X86/X86ScheduleSLM.td
@@ -408,10 +408,12 @@ defm : X86WriteResPairUnsupported<WriteVPMOV256>;
// Vector insert/extract operations.
defm : SLMWriteResPair<WriteVecInsert, [SLM_FPC_RSV0], 1>;
-def : WriteRes<WriteVecExtract, [SLM_FPC_RSV0]>;
+def : WriteRes<WriteVecExtract, [SLM_FPC_RSV0]> {
+ let NumMicroOps = 2;
+}
def : WriteRes<WriteVecExtractSt, [SLM_FPC_RSV0, SLM_MEC_RSV]> {
let Latency = 4;
- let NumMicroOps = 2;
+ let NumMicroOps = 5;
let ResourceCycles = [1, 2];
}
diff --git a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s
index e7554b97a3f5f..a84a32584cc9d 100644
--- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s
+++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s
@@ -268,7 +268,7 @@ xorps (%rax), %xmm2
# CHECK-NEXT: 1 4 1.00 * pavgb (%rax), %mm2
# CHECK-NEXT: 1 1 0.50 pavgw %mm0, %mm2
# CHECK-NEXT: 1 4 1.00 * pavgw (%rax), %mm2
-# CHECK-NEXT: 1 1 1.00 pextrw $1, %mm0, %ecx
+# CHECK-NEXT: 2 1 1.00 pextrw $1, %mm0, %ecx
# CHECK-NEXT: 1 1 1.00 pinsrw $1, %eax, %mm2
# CHECK-NEXT: 1 4 1.00 * pinsrw $1, (%rax), %mm2
# CHECK-NEXT: 1 1 0.50 pmaxsw %mm0, %mm2
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 fcf95505e28f3..3c699a6174ecf 100644
--- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
+++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse2.s
@@ -560,7 +560,7 @@ xorpd (%rax), %xmm2
# CHECK-NEXT: 1 4 1.00 * pcmpgtd (%rax), %xmm2
# CHECK-NEXT: 1 1 0.50 pcmpgtw %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * pcmpgtw (%rax), %xmm2
-# CHECK-NEXT: 1 1 1.00 pextrw $1, %xmm0, %ecx
+# CHECK-NEXT: 2 1 1.00 pextrw $1, %xmm0, %ecx
# CHECK-NEXT: 1 1 1.00 pinsrw $1, %eax, %xmm0
# CHECK-NEXT: 1 4 1.00 * pinsrw $1, (%rax), %xmm0
# CHECK-NEXT: 1 5 2.00 pmaddwd %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 3e4ece5163fb3..4b82cbc2234bd 100644
--- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
+++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse41.s
@@ -167,8 +167,8 @@ roundss $1, (%rax), %xmm2
# CHECK-NEXT: 6 15 8.00 * dppd $22, (%rax), %xmm2
# CHECK-NEXT: 9 15 12.00 dpps $22, %xmm0, %xmm2
# CHECK-NEXT: 10 18 12.00 * dpps $22, (%rax), %xmm2
-# CHECK-NEXT: 1 1 1.00 extractps $1, %xmm0, %ecx
-# CHECK-NEXT: 2 4 2.00 * extractps $1, %xmm0, (%rax)
+# CHECK-NEXT: 2 1 1.00 extractps $1, %xmm0, %ecx
+# CHECK-NEXT: 5 4 2.00 * extractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 1 1.00 insertps $1, %xmm0, %xmm2
# CHECK-NEXT: 1 4 1.00 * insertps $1, (%rax), %xmm2
# CHECK-NEXT: 1 3 1.00 * movntdqa (%rax), %xmm2
@@ -182,13 +182,13 @@ roundss $1, (%rax), %xmm2
# CHECK-NEXT: 1 4 1.00 * pblendw $11, (%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
-# CHECK-NEXT: 2 4 2.00 * pextrd $1, %xmm0, (%rax)
-# CHECK-NEXT: 1 1 1.00 pextrq $1, %xmm0, %rcx
-# CHECK-NEXT: 2 4 2.00 * pextrq $1, %xmm0, (%rax)
-# CHECK-NEXT: 2 4 2.00 * pextrw $1, %xmm0, (%rax)
+# CHECK-NEXT: 2 1 1.00 pextrb $1, %xmm0, %ecx
+# CHECK-NEXT: 5 4 2.00 * pextrb $1, %xmm0, (%rax)
+# CHECK-NEXT: 2 1 1.00 pextrd $1, %xmm0, %ecx
+# CHECK-NEXT: 5 4 2.00 * pextrd $1, %xmm0, (%rax)
+# CHECK-NEXT: 2 1 1.00 pextrq $1, %xmm0, %rcx
+# CHECK-NEXT: 5 4 2.00 * pextrq $1, %xmm0, (%rax)
+# CHECK-NEXT: 5 4 2.00 * pextrw $1, %xmm0, (%rax)
# CHECK-NEXT: 1 4 1.00 phminposuw %xmm0, %xmm2
# CHECK-NEXT: 1 7 1.00 * phminposuw (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 pinsrb $1, %eax, %xmm1
More information about the llvm-commits
mailing list