-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[llvm-exegesis] Add support for alder lake #88967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch adds the PFM counter definitions for Intel alder lake CPUs.
@llvm/pr-subscribers-backend-x86 Author: Aiden Grossman (boomanaiden154) ChangesThis patch adds the PFM counter definitions for Intel alder lake CPUs. Full diff: https://github.com/llvm/llvm-project/pull/88967.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td b/llvm/lib/Target/X86/X86PfmCounters.td
index d87a559aa353b1..11846477e64ae0 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -204,6 +204,27 @@ def : PfmCountersBinding<"icelake-server", IceLakePfmCounters>;
def : PfmCountersBinding<"rocketlake", IceLakePfmCounters>;
def : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
+def AlderLakePfmCounters : ProcPfmCounters {
+ let CycleCounter = UnhaltedCoreCyclesPfmCounter;
+ let UopsCounter = UopsIssuedPfmCounter;
+ let IssueCounters = [
+ PfmIssueCounter<"ADLPPort00", "uops_dispatched_port:port_0">,
+ PfmIssueCounter<"ADLPPort01", "uops_dispatched_port:port_1">,
+ PfmIssueCounter<"ADLPPort02", "uops_dispatched_port:port_2_3_10">,
+ PfmIssueCounter<"ADLPPort03", "uops_dispatched_port:port_2_3_10">,
+ PfmIssueCounter<"ADLPPort04", "uops_dispatched_port:port_4_9">,
+ PfmIssueCounter<"ADLPPort05", "uops_dispatched_port:port_5_11">,
+ PfmIssueCounter<"ADLPPort06", "uops_dispatched_port:port_6">,
+ PfmIssueCounter<"ADLPPort07", "uops_dispatched_port:port_7_8">,
+ PfmIssueCounter<"ADLPPort08", "uops_dispatched_port:port_7_8">,
+ PfmIssueCounter<"ADLPPort09", "uops_dispatched_port:port_4_9">,
+ PfmIssueCounter<"ADLPPort10", "uops_dispatched_port:port_2_3_10">,
+ PfmIssueCounter<"ADLPPort11", "uops_dispatched_port:port_5_11">,
+ ];
+ let ValidationCounters = DefaultIntelPfmValidationCounters;
+}
+def : PfmCountersBinding<"alderlake", AlderLakePfmCounters>;
+
// AMD X86 Counters.
defvar DefaultAMDPfmValidationCounters = [
PfmValidationCounter<InstructionRetired, "RETIRED_INSTRUCTIONS">,
|
From what I understand, LLVM just reports the microarch as alder lake for both golden cove and gracemont. Not sure this will end up being a large issue as cycles measurements should be the same between both and uops measurements aren't possible on gracemont. I also don't have access to any alder lake hardware, so I can't test this, but it should work. I've checked all the counter definitions against what exists in libpfm (at least tip of tree libpfm). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you map to the composite ports instead or repeating them?
What options do we have to hint to llvm-exegesis what CPU mask to allow?
It doesn't look like any of the composite ports actually map directly to the counters?
Can you clarify what you mean by this? As in differentiating between different microarchitectures on the same platform? I don't believe there is any support for doing that currently. There also isn't any support for CPU affinity masks either, but #85168 might get the ball rolling on that. |
PfmIssueCounter<"ADLPPort01", "uops_dispatched_port:port_1">, | ||
PfmIssueCounter<"ADLPPort02", "uops_dispatched_port:port_2_3_10">, | ||
PfmIssueCounter<"ADLPPort03", "uops_dispatched_port:port_2_3_10">, | ||
PfmIssueCounter<"ADLPPort04", "uops_dispatched_port:port_4_9">, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ADLPPort04_09 instead - adding the other ProcResGroup combos to X86SchedAlderlakeP.td shouldn't be a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't believe I missed that one along with 1-2 others. I've added in the ones that were missing as well to X86SchedAlderlakeP.td
, along with a ADLPPortAny
ProcResGroup
so that all of the overlapping groups have a super group (I believe that won't cause any issues?).
Setting an CPU affinity mask was what I had in mind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch adds the PFM counter definitions for Intel alder lake CPUs.