[llvm] a72cacb - [X86] AMD Zen 3: same-reg SSE XMM PANDN is a 1-cycle(!) dep-breaking zero-idiom
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Fri May 14 10:23:48 PDT 2021
Author: Roman Lebedev
Date: 2021-05-14T20:22:59+03:00
New Revision: a72cacb53f42704e7621b6f9e7fa9b21b49fdf76
URL: https://github.com/llvm/llvm-project/commit/a72cacb53f42704e7621b6f9e7fa9b21b49fdf76
DIFF: https://github.com/llvm/llvm-project/commit/a72cacb53f42704e7621b6f9e7fa9b21b49fdf76.diff
LOG: [X86] AMD Zen 3: same-reg SSE XMM PANDN is a 1-cycle(!) dep-breaking zero-idiom
As confirmed by the exegesis measurements, and ref docs.
Added:
Modified:
llvm/lib/Target/X86/X86ScheduleZnver3.td
llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-sse-xmm.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ScheduleZnver3.td b/llvm/lib/Target/X86/X86ScheduleZnver3.td
index 9f62219a15d8..956a7ba14c13 100644
--- a/llvm/lib/Target/X86/X86ScheduleZnver3.td
+++ b/llvm/lib/Target/X86/X86ScheduleZnver3.td
@@ -1572,7 +1572,8 @@ def : IsZeroIdiomFunction<[
ANDNPSrr, ANDNPDrr,
// int variants.
- PXORrr
+ PXORrr,
+ PANDNrr
], ZeroIdiomPredicate>,
// AVX XMM Zero-idioms.
diff --git a/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-sse-xmm.s b/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-sse-xmm.s
index 74b742cce10e..4962bfd421bd 100644
--- a/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-sse-xmm.s
+++ b/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-sse-xmm.s
@@ -490,12 +490,12 @@ pandn %xmm0, %xmm1
# CHECK: Iterations: 10000
# CHECK-NEXT: Instructions: 20000
-# CHECK-NEXT: Total Cycles: 20003
+# CHECK-NEXT: Total Cycles: 5004
# CHECK-NEXT: Total uOps: 20000
# CHECK: Dispatch Width: 6
-# CHECK-NEXT: uOps Per Cycle: 1.00
-# CHECK-NEXT: IPC: 1.00
+# CHECK-NEXT: uOps Per Cycle: 4.00
+# CHECK-NEXT: IPC: 4.00
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@@ -511,13 +511,13 @@ pandn %xmm0, %xmm1
# CHECK-NEXT: 1 1 0.25 pandn %xmm0, %xmm1
# CHECK: Register File statistics:
-# CHECK-NEXT: Total number of mappings created: 20000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Total number of mappings created: 10000
+# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
-# CHECK-NEXT: Total number of mappings created: 20000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Total number of mappings created: 10000
+# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@@ -555,16 +555,16 @@ pandn %xmm0, %xmm1
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12.0] [12.1] [13] [14.0] [14.1] [14.2] [15.0] [15.1] [15.2] [16.0] [16.1] Instructions:
-# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - pandn %xmm1, %xmm1
-# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - pandn %xmm0, %xmm1
+# CHECK-NEXT: - - - - - - - - - 0.50 0.25 0.25 - - - - - - - - - - - pandn %xmm1, %xmm1
+# CHECK-NEXT: - - - - - - - - 0.50 - 0.25 0.25 - - - - - - - - - - - pandn %xmm0, %xmm1
# CHECK: Timeline view:
-# CHECK-NEXT: Index 0123456
+# CHECK-NEXT: Index 01234
-# CHECK: [0,0] DeER .. pandn %xmm1, %xmm1
-# CHECK-NEXT: [0,1] D=eER.. pandn %xmm0, %xmm1
-# CHECK-NEXT: [1,0] D==eER. pandn %xmm1, %xmm1
-# CHECK-NEXT: [1,1] D===eER pandn %xmm0, %xmm1
+# CHECK: [0,0] DeER. pandn %xmm1, %xmm1
+# CHECK-NEXT: [0,1] D=eER pandn %xmm0, %xmm1
+# CHECK-NEXT: [1,0] DeE-R pandn %xmm1, %xmm1
+# CHECK-NEXT: [1,1] D=eER pandn %xmm0, %xmm1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@@ -573,6 +573,6 @@ pandn %xmm0, %xmm1
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
-# CHECK-NEXT: 0. 2 2.0 0.5 0.0 pandn %xmm1, %xmm1
-# CHECK-NEXT: 1. 2 3.0 0.0 0.0 pandn %xmm0, %xmm1
-# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
+# CHECK-NEXT: 0. 2 1.0 1.0 0.5 pandn %xmm1, %xmm1
+# CHECK-NEXT: 1. 2 2.0 0.0 0.0 pandn %xmm0, %xmm1
+# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
More information about the llvm-commits
mailing list