[llvm] c7662dc - [X86] MOVDDUP has the same sched behaviour as MOVSHDUP/MOVSLDUP on Skylake
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 04:50:48 PDT 2022
Author: Simon Pilgrim
Date: 2022-05-02T12:50:37+01:00
New Revision: c7662dc3e52801ec824d8473278fb976107d3e57
URL: https://github.com/llvm/llvm-project/commit/c7662dc3e52801ec824d8473278fb976107d3e57
DIFF: https://github.com/llvm/llvm-project/commit/c7662dc3e52801ec824d8473278fb976107d3e57.diff
LOG: [X86] MOVDDUP has the same sched behaviour as MOVSHDUP/MOVSLDUP on Skylake
Fixes an old TODO - confirmed on Agner + uops.info
Added:
Modified:
llvm/lib/Target/X86/X86SchedSkylakeClient.td
llvm/lib/Target/X86/X86SchedSkylakeServer.td
llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s
llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-sse3.s
llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s
llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-sse3.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86SchedSkylakeClient.td b/llvm/lib/Target/X86/X86SchedSkylakeClient.td
index 67ed1d8fd9fbb..05364e3434e4b 100644
--- a/llvm/lib/Target/X86/X86SchedSkylakeClient.td
+++ b/llvm/lib/Target/X86/X86SchedSkylakeClient.td
@@ -935,8 +935,7 @@ def SKLWriteResGroup58 : SchedWriteRes<[SKLPort23]> {
let ResourceCycles = [1];
}
def: InstRW<[SKLWriteResGroup58], (instregex "MOVSX(16|32|64)rm(8|16|32)",
- "MOVZX(16|32|64)rm(8|16)",
- "(V?)MOVDDUPrm")>; // TODO: Should this be SKLWriteResGroup67?
+ "MOVZX(16|32|64)rm(8|16)")>;
def SKLWriteResGroup59 : SchedWriteRes<[SKLPort0,SKLPort5]> {
let Latency = 5;
@@ -993,7 +992,8 @@ def: InstRW<[SKLWriteResGroup67], (instrs VBROADCASTSSrm,
VPBROADCASTDrm,
VPBROADCASTQrm)>;
def: InstRW<[SKLWriteResGroup67], (instregex "(V?)MOVSHDUPrm",
- "(V?)MOVSLDUPrm")>;
+ "(V?)MOVSLDUPrm",
+ "(V?)MOVDDUPrm")>;
def SKLWriteResGroup68 : SchedWriteRes<[SKLPort0]> {
let Latency = 6;
diff --git a/llvm/lib/Target/X86/X86SchedSkylakeServer.td b/llvm/lib/Target/X86/X86SchedSkylakeServer.td
index 0189acdd76c50..b682b51c298a8 100644
--- a/llvm/lib/Target/X86/X86SchedSkylakeServer.td
+++ b/llvm/lib/Target/X86/X86SchedSkylakeServer.td
@@ -1055,8 +1055,7 @@ def SKXWriteResGroup58 : SchedWriteRes<[SKXPort23]> {
let ResourceCycles = [1];
}
def: InstRW<[SKXWriteResGroup58], (instregex "MOVSX(16|32|64)rm(8|16|32)",
- "MOVZX(16|32|64)rm(8|16)",
- "(V?)MOVDDUPrm")>; // TODO: Should this be SKXWriteResGroup71?
+ "MOVZX(16|32|64)rm(8|16)")>;
def SKXWriteResGroup61 : SchedWriteRes<[SKXPort5,SKXPort015]> {
let Latency = 5;
@@ -1159,11 +1158,10 @@ def SKXWriteResGroup71 : SchedWriteRes<[SKXPort23]> {
}
def: InstRW<[SKXWriteResGroup71], (instrs VBROADCASTSSrm,
VPBROADCASTDrm,
- VPBROADCASTQrm,
- VMOVSHDUPrm,
- VMOVSLDUPrm,
- MOVSHDUPrm,
- MOVSLDUPrm)>;
+ VPBROADCASTQrm)>;
+def: InstRW<[SKXWriteResGroup71], (instregex "(V?)MOVSHDUPrm",
+ "(V?)MOVSLDUPrm",
+ "(V?)MOVDDUPrm")>;
def SKXWriteResGroup72 : SchedWriteRes<[SKXPort5]> {
let Latency = 6;
diff --git a/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s
index 5c0fc8e748656..066279443e8a8 100644
--- a/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s
+++ b/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s
@@ -1269,7 +1269,7 @@ vzeroupper
# CHECK-NEXT: 1 2 1.00 vmovd %xmm0, %ecx
# CHECK-NEXT: 2 1 1.00 * vmovd %xmm0, (%rax)
# CHECK-NEXT: 1 1 1.00 vmovddup %xmm0, %xmm2
-# CHECK-NEXT: 1 5 0.50 * vmovddup (%rax), %xmm2
+# CHECK-NEXT: 1 6 0.50 * vmovddup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 vmovddup %ymm0, %ymm2
# CHECK-NEXT: 1 7 0.50 * vmovddup (%rax), %ymm2
# CHECK-NEXT: 1 1 0.33 vmovdqa %xmm0, %xmm2
diff --git a/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-sse3.s b/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-sse3.s
index df495ed45be95..4c5908e6d9702 100644
--- a/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-sse3.s
+++ b/llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-sse3.s
@@ -58,7 +58,7 @@ mwait
# CHECK-NEXT: 1 6 0.50 * lddqu (%rax), %xmm2
# CHECK-NEXT: 1 100 0.25 U monitor
# CHECK-NEXT: 1 1 1.00 movddup %xmm0, %xmm2
-# CHECK-NEXT: 1 5 0.50 * movddup (%rax), %xmm2
+# CHECK-NEXT: 1 6 0.50 * movddup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 movshdup %xmm0, %xmm2
# CHECK-NEXT: 1 6 0.50 * movshdup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 movsldup %xmm0, %xmm2
diff --git a/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s
index 005c2eecf8df9..38170f8915eac 100644
--- a/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s
+++ b/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s
@@ -1269,7 +1269,7 @@ vzeroupper
# CHECK-NEXT: 1 2 1.00 vmovd %xmm0, %ecx
# CHECK-NEXT: 2 1 1.00 * vmovd %xmm0, (%rax)
# CHECK-NEXT: 1 1 1.00 vmovddup %xmm0, %xmm2
-# CHECK-NEXT: 1 5 0.50 * vmovddup (%rax), %xmm2
+# CHECK-NEXT: 1 6 0.50 * vmovddup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 vmovddup %ymm0, %ymm2
# CHECK-NEXT: 1 7 0.50 * vmovddup (%rax), %ymm2
# CHECK-NEXT: 1 1 0.33 vmovdqa %xmm0, %xmm2
diff --git a/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-sse3.s b/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-sse3.s
index 61cf0f1fdc393..e6bec1953fb84 100644
--- a/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-sse3.s
+++ b/llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-sse3.s
@@ -58,7 +58,7 @@ mwait
# CHECK-NEXT: 1 6 0.50 * lddqu (%rax), %xmm2
# CHECK-NEXT: 1 100 0.25 U monitor
# CHECK-NEXT: 1 1 1.00 movddup %xmm0, %xmm2
-# CHECK-NEXT: 1 5 0.50 * movddup (%rax), %xmm2
+# CHECK-NEXT: 1 6 0.50 * movddup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 movshdup %xmm0, %xmm2
# CHECK-NEXT: 1 6 0.50 * movshdup (%rax), %xmm2
# CHECK-NEXT: 1 1 1.00 movsldup %xmm0, %xmm2
More information about the llvm-commits
mailing list