Skip to content

Commit 01a5596

Browse files
[llvm-exegesis][X86] Groups ports 2,3, and 11 for Golden Cove (#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.
1 parent b7db403 commit 01a5596

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

llvm/lib/Target/X86/X86PfmCounters.td

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ def AlderLakePfmCounters : ProcPfmCounters {
210210
let IssueCounters = [
211211
PfmIssueCounter<"ADLPPort00", "uops_dispatched_port:port_0">,
212212
PfmIssueCounter<"ADLPPort01", "uops_dispatched_port:port_1">,
213-
PfmIssueCounter<"ADLPPort02_03_10", "uops_dispatched_port:port_2_3_10">,
213+
// The perfmon documentation and thus libpfm seems to incorrectly label
214+
// this performance counter, as ports 2,3, and 11 are actually grouped
215+
// according to most documentation. See #113941 for additional details.
216+
PfmIssueCounter<"ADLPPort02_03_11", "uops_dispatched_port:port_2_3_10">,
214217
PfmIssueCounter<"ADLPPort04_09", "uops_dispatched_port:port_4_9">,
215218
PfmIssueCounter<"ADLPPort05_11", "uops_dispatched_port:port_5_11">,
216219
PfmIssueCounter<"ADLPPort06", "uops_dispatched_port:port_6">,
@@ -226,7 +229,10 @@ def SapphireRapidsPfmCounters : ProcPfmCounters {
226229
let IssueCounters = [
227230
PfmIssueCounter<"SPRPort00", "uops_dispatched_port:port_0">,
228231
PfmIssueCounter<"SPRPort01", "uops_dispatched_port:port_1">,
229-
PfmIssueCounter<"SPRPort02_03_10", "uops_dispatched_port:port_2_3_10">,
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:port_2_3_10">,
230236
PfmIssueCounter<"SPRPort04_09", "uops_dispatched_port:port_4_9">,
231237
PfmIssueCounter<"SPRPort05_11", "uops_dispatched_port:port_5_11">,
232238
PfmIssueCounter<"SPRPort06", "uops_dispatched_port:port_6">,

llvm/lib/Target/X86/X86SchedAlderlakeP.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def ADLPPort01_05_10 : ProcResGroup<[ADLPPort01, ADLPPort05, ADLPPort10]>;
6060
def ADLPPort02_03 : ProcResGroup<[ADLPPort02, ADLPPort03]>;
6161
def ADLPPort02_03_07 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort07]>;
6262
def ADLPPort02_03_11 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort11]>;
63-
def ADLPPort02_03_10 : ProcResGroup<[ADLPPort02, ADLPPort03, ADLPPort10]>;
6463
def ADLPPort05_11 : ProcResGroup<[ADLPPort05, ADLPPort11]>;
6564
def ADLPPort07_08 : ProcResGroup<[ADLPPort07, ADLPPort08]>;
6665

llvm/lib/Target/X86/X86SchedSapphireRapids.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def SPRPort01_05 : ProcResGroup<[SPRPort01, SPRPort05]>;
5959
def SPRPort01_05_10 : ProcResGroup<[SPRPort01, SPRPort05, SPRPort10]>;
6060
def SPRPort02_03 : ProcResGroup<[SPRPort02, SPRPort03]>;
6161
def SPRPort02_03_11 : ProcResGroup<[SPRPort02, SPRPort03, SPRPort11]>;
62-
def SPRPort02_03_10 : ProcResGroup<[SPRPort02, SPRPort03, SPRPort10]>;
6362
def SPRPort05_11 : ProcResGroup<[SPRPort05, SPRPort11]>;
6463
def SPRPort07_08 : ProcResGroup<[SPRPort07, SPRPort08]>;
6564

0 commit comments

Comments
 (0)