[llvm] [llvm-exegesis][X86] Groups ports 2, 3, and 11 for Golden Cove (PR #115645)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 10 01:45:11 PST 2024
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/115645
This patch updates the PFM counter mappings for Sapphire Rapids and Alder Lake (p-cores) to group ports 2,3, and 11 despite the naming of the performance counters. This is how the scheduling models assume things work within LLVM, and seems to be a mistake within the Intel perfmon documentation.
Fixes #113941.
>From c72927b873f02cdd46a1bf736adca3ed223229f6 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sun, 10 Nov 2024 09:41:43 +0000
Subject: [PATCH] [llvm-exegesis][X86] Groups ports 2,3, and 11 for Golden Cove
This patch updates the PFM counter mappings for Sapphire Rapids and
Alder Lake (p-cores) to group ports 2,3, and 11 despite the naming of
the performance counters. This is how the scheduling models assume
things work within LLVM, and seems to be a mistake within the Intel
perfmon documentation.
Fixes #113941.
---
llvm/lib/Target/X86/X86PfmCounters.td | 10 ++++++++--
llvm/lib/Target/X86/X86SchedAlderlakeP.td | 1 -
llvm/lib/Target/X86/X86SchedSapphireRapids.td | 1 -
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td b/llvm/lib/Target/X86/X86PfmCounters.td
index 38d8d19091e0fd..190dec2f4e391e 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -210,7 +210,10 @@ def AlderLakePfmCounters : ProcPfmCounters {
let IssueCounters = [
PfmIssueCounter<"ADLPPort00", "uops_dispatched_port:port_0">,
PfmIssueCounter<"ADLPPort01", "uops_dispatched_port:port_1">,
- PfmIssueCounter<"ADLPPort02_03_10", "uops_dispatched_port:port_2_3_10">,
+ // 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:port_2_3_10">,
PfmIssueCounter<"ADLPPort04_09", "uops_dispatched_port:port_4_9">,
PfmIssueCounter<"ADLPPort05_11", "uops_dispatched_port:port_5_11">,
PfmIssueCounter<"ADLPPort06", "uops_dispatched_port:port_6">,
@@ -226,7 +229,10 @@ def SapphireRapidsPfmCounters : ProcPfmCounters {
let IssueCounters = [
PfmIssueCounter<"SPRPort00", "uops_dispatched_port:port_0">,
PfmIssueCounter<"SPRPort01", "uops_dispatched_port:port_1">,
- PfmIssueCounter<"SPRPort02_03_10", "uops_dispatched_port:port_2_3_10">,
+ // 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<"SPRPort02_03_11", "uops_dispatched_port:port_2_3_10">,
PfmIssueCounter<"SPRPort04_09", "uops_dispatched_port:port_4_9">,
PfmIssueCounter<"SPRPort05_11", "uops_dispatched_port:port_5_11">,
PfmIssueCounter<"SPRPort06", "uops_dispatched_port:port_6">,
diff --git a/llvm/lib/Target/X86/X86SchedAlderlakeP.td b/llvm/lib/Target/X86/X86SchedAlderlakeP.td
index aec6906310d96b..f8c6b32a853be9 100644
--- a/llvm/lib/Target/X86/X86SchedAlderlakeP.td
+++ b/llvm/lib/Target/X86/X86SchedAlderlakeP.td
@@ -60,7 +60,6 @@ def ADLPPort01_05_10 : ProcResGroup<[ADLPPort01, ADLPPort05, ADLPPort10]>;
def ADLPPort02_03 : ProcResGroup<[ADLPPort02, ADLPPort03]>;
def ADLPPort02_03_07 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort07]>;
def ADLPPort02_03_11 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort11]>;
-def ADLPPort02_03_10 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort10]>;
def ADLPPort05_11 : ProcResGroup<[ADLPPort05, ADLPPort11]>;
def ADLPPort07_08 : ProcResGroup<[ADLPPort07, ADLPPort08]>;
diff --git a/llvm/lib/Target/X86/X86SchedSapphireRapids.td b/llvm/lib/Target/X86/X86SchedSapphireRapids.td
index b0ebe70c31fd44..0545f9b7f4c00e 100644
--- a/llvm/lib/Target/X86/X86SchedSapphireRapids.td
+++ b/llvm/lib/Target/X86/X86SchedSapphireRapids.td
@@ -59,7 +59,6 @@ def SPRPort01_05 : ProcResGroup<[SPRPort01, SPRPort05]>;
def SPRPort01_05_10 : ProcResGroup<[SPRPort01, SPRPort05, SPRPort10]>;
def SPRPort02_03 : ProcResGroup<[SPRPort02, SPRPort03]>;
def SPRPort02_03_11 : ProcResGroup<[SPRPort02, SPRPort03, SPRPort11]>;
-def SPRPort02_03_10 : ProcResGroup<[SPRPort02, SPRPort03, SPRPort10]>;
def SPRPort05_11 : ProcResGroup<[SPRPort05, SPRPort11]>;
def SPRPort07_08 : ProcResGroup<[SPRPort07, SPRPort08]>;
More information about the llvm-commits
mailing list