[llvm] 6a64c46 - [X86] AMD Zen 3: same-reg AVX YMM VPCMP is dep breaking one-idiom
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon May 10 13:50:07 PDT 2021
Author: Roman Lebedev
Date: 2021-05-10T23:49:27+03:00
New Revision: 6a64c462eb82f5f37e4ce512f4c25c474ddfcc4c
URL: https://github.com/llvm/llvm-project/commit/6a64c462eb82f5f37e4ce512f4c25c474ddfcc4c
DIFF: https://github.com/llvm/llvm-project/commit/6a64c462eb82f5f37e4ce512f4c25c474ddfcc4c.diff
LOG: [X86] AMD Zen 3: same-reg AVX YMM VPCMP is dep breaking one-idiom
As measured by exegesis, and confirmed by ref docs.
Still not zero-cycle :)
Added:
Modified:
llvm/lib/Target/X86/X86ScheduleZnver3.td
llvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ScheduleZnver3.td b/llvm/lib/Target/X86/X86ScheduleZnver3.td
index 3f753d759dea..571aedf15d4c 100644
--- a/llvm/lib/Target/X86/X86ScheduleZnver3.td
+++ b/llvm/lib/Target/X86/X86ScheduleZnver3.td
@@ -1561,6 +1561,11 @@ def : IsDepBreakingFunction<[
DepBreakingClass<[
VPCMPEQBrr, VPCMPEQWrr, VPCMPEQDrr, VPCMPEQQrr
], ZeroIdiomPredicate>,
+
+ // AVX YMM
+ DepBreakingClass<[
+ VPCMPEQBYrr, VPCMPEQWYrr, VPCMPEQDYrr, VPCMPEQQYrr
+ ], ZeroIdiomPredicate>,
]>;
} // SchedModel
diff --git a/llvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s b/llvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
index 23ed840f13ed..eb2bb979b7f5 100644
--- a/llvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
+++ b/llvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
@@ -25,12 +25,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Iterations: 1000
# CHECK-NEXT: Instructions: 2000
-# CHECK-NEXT: Total Cycles: 2003
+# CHECK-NEXT: Total Cycles: 504
# CHECK-NEXT: Total uOps: 2000
# CHECK: Dispatch Width: 6
-# CHECK-NEXT: uOps Per Cycle: 1.00
-# CHECK-NEXT: IPC: 1.00
+# CHECK-NEXT: uOps Per Cycle: 3.97
+# CHECK-NEXT: IPC: 3.97
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@@ -47,12 +47,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@@ -90,16 +90,16 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 - - - - - - - - - - - vpcmpeqb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - vpaddb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 0.50 - - - - - - - - - - - - vpcmpeqb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 - 0.50 - - - - - - - - - - - vpaddb %ymm0, %ymm0, %ymm0
# CHECK: Timeline view:
-# CHECK-NEXT: Index 0123456
+# CHECK-NEXT: Index 01234
-# CHECK: [0,0] DeER .. vpcmpeqb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [0,1] D=eER.. vpaddb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,0] D==eER. vpcmpeqb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,1] D===eER vpaddb %ymm0, %ymm0, %ymm0
+# CHECK: [0,0] DeER. vpcmpeqb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [0,1] D=eER vpaddb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,0] DeE-R vpcmpeqb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,1] D=eER vpaddb %ymm0, %ymm0, %ymm0
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@@ -108,20 +108,20 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 vpcmpeqb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 1. 2 3.0 0.0 0.0 vpaddb %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
+# CHECK-NEXT: 0. 2 1.0 1.0 0.5 vpcmpeqb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 1. 2 2.0 0.0 0.0 vpaddb %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [1] Code Region
# CHECK: Iterations: 1000
# CHECK-NEXT: Instructions: 2000
-# CHECK-NEXT: Total Cycles: 2003
+# CHECK-NEXT: Total Cycles: 504
# CHECK-NEXT: Total uOps: 2000
# CHECK: Dispatch Width: 6
-# CHECK-NEXT: uOps Per Cycle: 1.00
-# CHECK-NEXT: IPC: 1.00
+# CHECK-NEXT: uOps Per Cycle: 3.97
+# CHECK-NEXT: IPC: 3.97
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@@ -138,12 +138,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@@ -181,16 +181,16 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 - - - - - - - - - - - vpcmpeqw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - vpaddw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 0.50 - - - - - - - - - - - - vpcmpeqw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 - 0.50 - - - - - - - - - - - vpaddw %ymm0, %ymm0, %ymm0
# CHECK: Timeline view:
-# CHECK-NEXT: Index 0123456
+# CHECK-NEXT: Index 01234
-# CHECK: [0,0] DeER .. vpcmpeqw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [0,1] D=eER.. vpaddw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,0] D==eER. vpcmpeqw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,1] D===eER vpaddw %ymm0, %ymm0, %ymm0
+# CHECK: [0,0] DeER. vpcmpeqw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [0,1] D=eER vpaddw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,0] DeE-R vpcmpeqw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,1] D=eER vpaddw %ymm0, %ymm0, %ymm0
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@@ -199,20 +199,20 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 vpcmpeqw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 1. 2 3.0 0.0 0.0 vpaddw %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
+# CHECK-NEXT: 0. 2 1.0 1.0 0.5 vpcmpeqw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 1. 2 2.0 0.0 0.0 vpaddw %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [2] Code Region
# CHECK: Iterations: 1000
# CHECK-NEXT: Instructions: 2000
-# CHECK-NEXT: Total Cycles: 2003
+# CHECK-NEXT: Total Cycles: 504
# CHECK-NEXT: Total uOps: 2000
# CHECK: Dispatch Width: 6
-# CHECK-NEXT: uOps Per Cycle: 1.00
-# CHECK-NEXT: IPC: 1.00
+# CHECK-NEXT: uOps Per Cycle: 3.97
+# CHECK-NEXT: IPC: 3.97
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@@ -229,12 +229,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 74
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@@ -272,16 +272,16 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 - - - - - - - - - - - vpcmpeqd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - vpaddd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 0.50 - - - - - - - - - - - - vpcmpeqd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: - - - - - - - - 0.25 0.25 - 0.50 - - - - - - - - - - - vpaddd %ymm0, %ymm0, %ymm0
# CHECK: Timeline view:
-# CHECK-NEXT: Index 0123456
+# CHECK-NEXT: Index 01234
-# CHECK: [0,0] DeER .. vpcmpeqd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [0,1] D=eER.. vpaddd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,0] D==eER. vpcmpeqd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,1] D===eER vpaddd %ymm0, %ymm0, %ymm0
+# CHECK: [0,0] DeER. vpcmpeqd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [0,1] D=eER vpaddd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,0] DeE-R vpcmpeqd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,1] D=eER vpaddd %ymm0, %ymm0, %ymm0
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@@ -290,20 +290,20 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 vpcmpeqd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 1. 2 3.0 0.0 0.0 vpaddd %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
+# CHECK-NEXT: 0. 2 1.0 1.0 0.5 vpcmpeqd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 1. 2 2.0 0.0 0.0 vpaddd %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [3] Code Region
# CHECK: Iterations: 1000
# CHECK-NEXT: Instructions: 2000
-# CHECK-NEXT: Total Cycles: 2003
+# CHECK-NEXT: Total Cycles: 504
# CHECK-NEXT: Total uOps: 2000
# CHECK: Dispatch Width: 6
-# CHECK-NEXT: uOps Per Cycle: 1.00
-# CHECK-NEXT: IPC: 1.00
+# CHECK-NEXT: uOps Per Cycle: 3.97
+# CHECK-NEXT: IPC: 3.97
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@@ -320,12 +320,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 73
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 2000
-# CHECK-NEXT: Max number of mappings used: 66
+# CHECK-NEXT: Max number of mappings used: 73
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@@ -367,12 +367,12 @@ vpaddq %ymm0, %ymm0, %ymm0
# CHECK-NEXT: - - - - - - - - - - 0.50 0.50 - - - - - - - - - - - vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Timeline view:
-# CHECK-NEXT: Index 0123456
+# CHECK-NEXT: Index 01234
-# CHECK: [0,0] DeER .. vpcmpeqq %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [0,1] D=eER.. vpaddq %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,0] D==eER. vpcmpeqq %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: [1,1] D===eER vpaddq %ymm0, %ymm0, %ymm0
+# CHECK: [0,0] DeER. vpcmpeqq %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [0,1] D=eER vpaddq %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,0] DeE-R vpcmpeqq %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: [1,1] D=eER vpaddq %ymm0, %ymm0, %ymm0
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@@ -381,6 +381,6 @@ vpaddq %ymm0, %ymm0, %ymm0
# 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 vpcmpeqq %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 1. 2 3.0 0.0 0.0 vpaddq %ymm0, %ymm0, %ymm0
-# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
+# CHECK-NEXT: 0. 2 1.0 1.0 0.5 vpcmpeqq %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 1. 2 2.0 0.0 0.0 vpaddq %ymm0, %ymm0, %ymm0
+# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
More information about the llvm-commits
mailing list