Skip to content

Commit 2b25246

Browse files
[X86] Swap ports 10 and 11 in SapphireRapids Scheduling Model
Based on intel/perfmon#149, the documentation is incorrect and the pfm counter names are actually correct. This patch adjusts the SapphireRapids scheduling model to match the performance counter naming/ correct naming that will soon be reflected in the optimization manual. This fixes part of #117360.
1 parent 215f3dd commit 2b25246

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5578
-5581
lines changed

llvm/lib/Target/X86/X86PfmCounters.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,7 @@ def SapphireRapidsPfmCounters : ProcPfmCounters {
229229
let IssueCounters = [
230230
PfmIssueCounter<"SPRPort00", "uops_dispatched:port_0">,
231231
PfmIssueCounter<"SPRPort01", "uops_dispatched:port_1">,
232-
// The perfmon documentation and thus libpfm seems to incorrectly label
233-
// this performance counter, as ports 2,3, and 11 are actually grouped
234-
// according to most documentation. See #113941 for additional details.
235-
PfmIssueCounter<"SPRPort02_03_11", "uops_dispatched:port_2_3_10">,
232+
PfmIssueCounter<"SPRPort02_03_10", "uops_dispatched:port_2_3_10">,
236233
PfmIssueCounter<"SPRPort04_09", "uops_dispatched:port_4_9">,
237234
PfmIssueCounter<"SPRPort05_11", "uops_dispatched:port_5_11">,
238235
PfmIssueCounter<"SPRPort06", "uops_dispatched:port_6">,

llvm/lib/Target/X86/X86SchedSapphireRapids.td

Lines changed: 413 additions & 413 deletions
Large diffs are not rendered by default.

llvm/test/tools/llvm-mca/X86/SapphireRapids/independent-load-stores.s

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@
6868

6969
# ALL: Resource pressure per iteration:
7070
# ALL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
71-
# ALL-NEXT: 2.00 2.00 3.33 3.33 5.00 2.00 2.00 5.00 5.00 5.00 2.00 3.34 -
71+
# ALL-NEXT: 2.00 2.00 3.33 3.33 5.00 2.00 2.00 5.00 5.00 5.00 3.34 2.00 -
7272

7373
# ALL: Resource pressure by instruction:
7474
# ALL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
75-
# ALL-NEXT: - - 0.33 0.33 - - - - 1.00 1.00 1.00 0.34 - addq $44, 64(%r14)
76-
# ALL-NEXT: - - 0.33 0.34 1.00 - 1.00 1.00 - - - 0.33 - addq $44, 128(%r14)
77-
# ALL-NEXT: - - 0.34 0.33 - 1.00 - - 1.00 1.00 - 0.33 - addq $44, 192(%r14)
78-
# ALL-NEXT: - 1.00 0.33 0.33 1.00 - - 1.00 - - - 0.34 - addq $44, 256(%r14)
79-
# ALL-NEXT: 1.00 - 0.33 0.34 - - - - 1.00 1.00 - 0.33 - addq $44, 320(%r14)
80-
# ALL-NEXT: - - 0.34 0.33 1.00 - - 1.00 - - 1.00 0.33 - addq $44, 384(%r14)
81-
# ALL-NEXT: - - 0.33 0.33 - - 1.00 - 1.00 1.00 - 0.34 - addq $44, 448(%r14)
82-
# ALL-NEXT: - - 0.33 0.34 1.00 1.00 - 1.00 - - - 0.33 - addq $44, 512(%r14)
83-
# ALL-NEXT: - 1.00 0.34 0.33 - - - - 1.00 1.00 - 0.33 - addq $44, 576(%r14)
84-
# ALL-NEXT: 1.00 - 0.33 0.33 1.00 - - 1.00 - - - 0.34 - addq $44, 640(%r14)
75+
# ALL-NEXT: - - 0.33 0.33 - - - - 1.00 1.00 0.34 1.00 - addq $44, 64(%r14)
76+
# ALL-NEXT: - - 0.33 0.34 1.00 - 1.00 1.00 - - 0.33 - - addq $44, 128(%r14)
77+
# ALL-NEXT: - - 0.34 0.33 - 1.00 - - 1.00 1.00 0.33 - - addq $44, 192(%r14)
78+
# ALL-NEXT: - 1.00 0.33 0.33 1.00 - - 1.00 - - 0.34 - - addq $44, 256(%r14)
79+
# ALL-NEXT: 1.00 - 0.33 0.34 - - - - 1.00 1.00 0.33 - - addq $44, 320(%r14)
80+
# ALL-NEXT: - - 0.34 0.33 1.00 - - 1.00 - - 0.33 1.00 - addq $44, 384(%r14)
81+
# ALL-NEXT: - - 0.33 0.33 - - 1.00 - 1.00 1.00 0.34 - - addq $44, 448(%r14)
82+
# ALL-NEXT: - - 0.33 0.34 1.00 1.00 - 1.00 - - 0.33 - - addq $44, 512(%r14)
83+
# ALL-NEXT: - 1.00 0.34 0.33 - - - - 1.00 1.00 0.33 - - addq $44, 576(%r14)
84+
# ALL-NEXT: 1.00 - 0.33 0.33 1.00 - - 1.00 - - 0.34 - - addq $44, 640(%r14)
8585

8686
# ALL: Timeline view:
8787

llvm/test/tools/llvm-mca/X86/SapphireRapids/resources-adx.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ adox (%rbx), %rcx
4646

4747
# CHECK: Resource pressure per iteration:
4848
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
49-
# CHECK-NEXT: 4.00 - 1.33 1.33 - - 4.00 - - - - 1.33 -
49+
# CHECK-NEXT: 4.00 - 1.33 1.33 - - 4.00 - - - 1.33 - -
5050

5151
# CHECK: Resource pressure by instruction:
5252
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
5353
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adcxl %ebx, %ecx
54-
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adcxl (%rbx), %ecx
54+
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adcxl (%rbx), %ecx
5555
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adcxq %rbx, %rcx
56-
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adcxq (%rbx), %rcx
56+
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adcxq (%rbx), %rcx
5757
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adoxl %ebx, %ecx
58-
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adoxl (%rbx), %ecx
58+
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adoxl (%rbx), %ecx
5959
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adoxq %rbx, %rcx
60-
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adoxq (%rbx), %rcx
60+
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adoxq (%rbx), %rcx

llvm/test/tools/llvm-mca/X86/SapphireRapids/resources-aes.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ aeskeygenassist $22, (%rax), %xmm2
5858

5959
# CHECK: Resource pressure per iteration:
6060
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
61-
# CHECK-NEXT: 17.33 10.33 2.00 2.00 - 9.33 2.00 - - - - 2.00 -
61+
# CHECK-NEXT: 17.33 10.33 2.00 2.00 - 9.33 2.00 - - - 2.00 - -
6262

6363
# CHECK: Resource pressure by instruction:
6464
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
6565
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesdec %xmm0, %xmm2
66-
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesdec (%rax), %xmm2
66+
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesdec (%rax), %xmm2
6767
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesdeclast %xmm0, %xmm2
68-
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesdeclast (%rax), %xmm2
68+
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesdeclast (%rax), %xmm2
6969
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesenc %xmm0, %xmm2
70-
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesenc (%rax), %xmm2
70+
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesenc (%rax), %xmm2
7171
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesenclast %xmm0, %xmm2
72-
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesenclast (%rax), %xmm2
72+
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesenclast (%rax), %xmm2
7373
# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - aesimc %xmm0, %xmm2
74-
# CHECK-NEXT: 1.00 1.00 0.33 0.33 - - - - - - - 0.33 - aesimc (%rax), %xmm2
74+
# CHECK-NEXT: 1.00 1.00 0.33 0.33 - - - - - - 0.33 - - aesimc (%rax), %xmm2
7575
# CHECK-NEXT: 5.83 2.33 - - - 4.83 1.00 - - - - - - aeskeygenassist $22, %xmm0, %xmm2
76-
# CHECK-NEXT: 5.50 2.00 0.33 0.33 - 4.50 1.00 - - - - 0.33 - aeskeygenassist $22, (%rax), %xmm2
76+
# CHECK-NEXT: 5.50 2.00 0.33 0.33 - 4.50 1.00 - - - 0.33 - - aeskeygenassist $22, (%rax), %xmm2

0 commit comments

Comments
 (0)