Skip to content

Commit

Permalink
[X86] Swap ports 10 and 11 in Alder Lake Scheduling Model
Browse files Browse the repository at this point in the history
Based on intel/perfmon#149, the documentation is
incorrect and the pfm counter names are actually correct. This patch adjusts
the Alder Lake scheduling model to match the performance counter naming/
correct naming that will soon be reflected in the optimization manual.

This fixes part of llvm#117360.
  • Loading branch information
boomanaiden154 committed Nov 24, 2024
1 parent 1a2cc2b commit fc23c21
Show file tree
Hide file tree
Showing 40 changed files with 2,058 additions and 2,062 deletions.
5 changes: 1 addition & 4 deletions llvm/lib/Target/X86/X86PfmCounters.td
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,7 @@ def AlderLakePfmCounters : ProcPfmCounters {
let IssueCounters = [
PfmIssueCounter<"ADLPPort00", "uops_dispatched:port_0">,
PfmIssueCounter<"ADLPPort01", "uops_dispatched:port_1">,
// The perfmon documentation and thus libpfm seems to incorrectly label
// this performance counter, as ports 2,3, and 11 are actually grouped
// according to most documentation. See #113941 for additional details.
PfmIssueCounter<"ADLPPort02_03_11", "uops_dispatched:port_2_3_10">,
PfmIssueCounter<"ADLPPort02_03_10", "uops_dispatched:port_2_3_10">,
PfmIssueCounter<"ADLPPort04_09", "uops_dispatched:port_4_9">,
PfmIssueCounter<"ADLPPort05_11", "uops_dispatched:port_5_11">,
PfmIssueCounter<"ADLPPort06", "uops_dispatched:port_6">,
Expand Down
481 changes: 240 additions & 241 deletions llvm/lib/Target/X86/X86SchedAlderlakeP.td

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions llvm/test/tools/llvm-mca/X86/AlderlakeP/independent-load-stores.s
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@

# ALL: Resource pressure per iteration:
# ALL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
# 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 -
# 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 -

# ALL: Resource pressure by instruction:
# ALL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
# ALL-NEXT: - - 0.33 0.33 - - - - 1.00 1.00 1.00 0.34 - addq $44, 64(%r14)
# ALL-NEXT: - - 0.33 0.34 1.00 - 1.00 1.00 - - - 0.33 - addq $44, 128(%r14)
# ALL-NEXT: - - 0.34 0.33 - 1.00 - - 1.00 1.00 - 0.33 - addq $44, 192(%r14)
# ALL-NEXT: - 1.00 0.33 0.33 1.00 - - 1.00 - - - 0.34 - addq $44, 256(%r14)
# ALL-NEXT: 1.00 - 0.33 0.34 - - - - 1.00 1.00 - 0.33 - addq $44, 320(%r14)
# ALL-NEXT: - - 0.34 0.33 1.00 - - 1.00 - - 1.00 0.33 - addq $44, 384(%r14)
# ALL-NEXT: - - 0.33 0.33 - - 1.00 - 1.00 1.00 - 0.34 - addq $44, 448(%r14)
# ALL-NEXT: - - 0.33 0.34 1.00 1.00 - 1.00 - - - 0.33 - addq $44, 512(%r14)
# ALL-NEXT: - 1.00 0.34 0.33 - - - - 1.00 1.00 - 0.33 - addq $44, 576(%r14)
# ALL-NEXT: 1.00 - 0.33 0.33 1.00 - - 1.00 - - - 0.34 - addq $44, 640(%r14)
# ALL-NEXT: - - 0.33 0.33 - - - - 1.00 1.00 0.34 1.00 - addq $44, 64(%r14)
# ALL-NEXT: - - 0.33 0.34 1.00 - 1.00 1.00 - - 0.33 - - addq $44, 128(%r14)
# ALL-NEXT: - - 0.34 0.33 - 1.00 - - 1.00 1.00 0.33 - - addq $44, 192(%r14)
# ALL-NEXT: - 1.00 0.33 0.33 1.00 - - 1.00 - - 0.34 - - addq $44, 256(%r14)
# ALL-NEXT: 1.00 - 0.33 0.34 - - - - 1.00 1.00 0.33 - - addq $44, 320(%r14)
# ALL-NEXT: - - 0.34 0.33 1.00 - - 1.00 - - 0.33 1.00 - addq $44, 384(%r14)
# ALL-NEXT: - - 0.33 0.33 - - 1.00 - 1.00 1.00 0.34 - - addq $44, 448(%r14)
# ALL-NEXT: - - 0.33 0.34 1.00 1.00 - 1.00 - - 0.33 - - addq $44, 512(%r14)
# ALL-NEXT: - 1.00 0.34 0.33 - - - - 1.00 1.00 0.33 - - addq $44, 576(%r14)
# ALL-NEXT: 1.00 - 0.33 0.33 1.00 - - 1.00 - - 0.34 - - addq $44, 640(%r14)

# ALL: Timeline view:

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/tools/llvm-mca/X86/AlderlakeP/resources-adx.s
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ adox (%rbx), %rcx

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

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adcxl %ebx, %ecx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adcxl (%rbx), %ecx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adcxl (%rbx), %ecx
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adcxq %rbx, %rcx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adcxq (%rbx), %rcx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adcxq (%rbx), %rcx
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adoxl %ebx, %ecx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adoxl (%rbx), %ecx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adoxl (%rbx), %ecx
# CHECK-NEXT: 0.50 - - - - - 0.50 - - - - - - adoxq %rbx, %rcx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - - 0.33 - adoxq (%rbx), %rcx
# CHECK-NEXT: 0.50 - 0.33 0.33 - - 0.50 - - - 0.33 - - adoxq (%rbx), %rcx
14 changes: 7 additions & 7 deletions llvm/test/tools/llvm-mca/X86/AlderlakeP/resources-aes.s
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ aeskeygenassist $22, (%rax), %xmm2

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

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesdec %xmm0, %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesdec (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesdec (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesdeclast %xmm0, %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesdeclast (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesdeclast (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesenc %xmm0, %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesenc (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesenc (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - aesenclast %xmm0, %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - - 0.33 - aesenclast (%rax), %xmm2
# CHECK-NEXT: 0.50 0.50 0.33 0.33 - - - - - - 0.33 - - aesenclast (%rax), %xmm2
# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - aesimc %xmm0, %xmm2
# CHECK-NEXT: 1.00 1.00 0.33 0.33 - - - - - - - 0.33 - aesimc (%rax), %xmm2
# CHECK-NEXT: 1.00 1.00 0.33 0.33 - - - - - - 0.33 - - aesimc (%rax), %xmm2
# CHECK-NEXT: 5.83 2.33 - - - 4.83 1.00 - - - - - - aeskeygenassist $22, %xmm0, %xmm2
# CHECK-NEXT: 5.50 2.00 0.33 0.33 - 4.50 1.00 - - - - 0.33 - aeskeygenassist $22, (%rax), %xmm2
# CHECK-NEXT: 5.50 2.00 0.33 0.33 - 4.50 1.00 - - - 0.33 - - aeskeygenassist $22, (%rax), %xmm2
Loading

0 comments on commit fc23c21

Please sign in to comment.