Skip to content

Commit f65265a

Browse files
[llvm-exegesis] Fix validation counters
While landing #76652, I realized I messed up a rebase/merge at some point and some of the changes I intended to land with #76652 ended up in a different PR (#76653) instead. This patch fixes the validation counters to how they were intended to land in #76652.
1 parent f7678c8 commit f65265a

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

llvm/include/llvm/Target/TargetPfmCounters.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ class ValidationEvent <int event_number> {
3535
int EventNumber = event_number;
3636
}
3737

38-
def L1DCacheLoadMiss : ValidationEvent<0>;
39-
def InstructionRetired : ValidationEvent<1>;
40-
def DataTLBLoadMiss : ValidationEvent<2>;
41-
def DataTLBStoreMiss : ValidationEvent<3>;
38+
def InstructionRetired : ValidationEvent<0>;
4239

4340
// PfmValidationCounter provides a mapping between the events that are
4441
// are interesting in regards to the snippet execution environment and

llvm/lib/Target/X86/X86PfmCounters.td

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def DefaultPfmCounters : ProcPfmCounters {}
1818
def : PfmCountersDefaultBinding<DefaultPfmCounters>;
1919

2020
// Intel X86 Counters.
21+
defvar DefaultIntelPfmValidationCounters = [
22+
PfmValidationCounter<InstructionRetired, "INSTRUCTIONS_RETIRED">
23+
];
24+
2125
def PentiumPfmCounters : ProcPfmCounters {
2226
let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2327
let UopsCounter = PfmCounter<"uops_retired">;
@@ -100,6 +104,7 @@ def SandyBridgePfmCounters : ProcPfmCounters {
100104
PfmIssueCounter<"SBPort4", "uops_dispatched_port:port_4">,
101105
PfmIssueCounter<"SBPort5", "uops_dispatched_port:port_5">
102106
];
107+
let ValidationCounters = DefaultIntelPfmValidationCounters;
103108
}
104109
def : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>;
105110
def : PfmCountersBinding<"ivybridge", SandyBridgePfmCounters>;
@@ -117,6 +122,7 @@ def HaswellPfmCounters : ProcPfmCounters {
117122
PfmIssueCounter<"HWPort6", "uops_executed_port:port_6">,
118123
PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
119124
];
125+
let ValidationCounters = DefaultIntelPfmValidationCounters;
120126
}
121127
def : PfmCountersBinding<"haswell", HaswellPfmCounters>;
122128

@@ -133,6 +139,7 @@ def BroadwellPfmCounters : ProcPfmCounters {
133139
PfmIssueCounter<"BWPort6", "uops_executed_port:port_6">,
134140
PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
135141
];
142+
let ValidationCounters = DefaultIntelPfmValidationCounters;
136143
}
137144
def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
138145

@@ -149,6 +156,7 @@ def SkylakeClientPfmCounters : ProcPfmCounters {
149156
PfmIssueCounter<"SKLPort6", "uops_dispatched_port:port_6">,
150157
PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
151158
];
159+
let ValidationCounters = DefaultIntelPfmValidationCounters;
152160
}
153161
def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
154162

@@ -165,6 +173,7 @@ def SkylakeServerPfmCounters : ProcPfmCounters {
165173
PfmIssueCounter<"SKXPort6", "uops_dispatched_port:port_6">,
166174
PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
167175
];
176+
let ValidationCounters = DefaultIntelPfmValidationCounters;
168177
}
169178
def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
170179
def : PfmCountersBinding<"cascadelake", SkylakeServerPfmCounters>;
@@ -182,13 +191,18 @@ def IceLakePfmCounters : ProcPfmCounters {
182191
PfmIssueCounter<"ICXPort6", "uops_dispatched_port:port_6">,
183192
PfmIssueCounter<"ICXPort78", "uops_dispatched_port:port_7_8">
184193
];
194+
let ValidationCounters = DefaultIntelPfmValidationCounters;
185195
}
186196
def : PfmCountersBinding<"icelake-client", IceLakePfmCounters>;
187197
def : PfmCountersBinding<"icelake-server", IceLakePfmCounters>;
188198
def : PfmCountersBinding<"rocketlake", IceLakePfmCounters>;
189199
def : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
190200

191201
// AMD X86 Counters.
202+
defvar DefaultAMDPfmValidationCounters = [
203+
PfmValidationCounter<InstructionRetired, "RETIRED_INSTRUCTIONS">
204+
];
205+
192206
// Set basic counters for AMD cpus that we know libpfm4 supports.
193207
def DefaultAMDPfmCounters : ProcPfmCounters {
194208
let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
@@ -265,6 +279,7 @@ def ZnVer1PfmCounters : ProcPfmCounters {
265279
PfmIssueCounter<"ZnAGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">,
266280
PfmIssueCounter<"ZnDivider", "div_op_count">
267281
];
282+
let ValidationCounters = DefaultAMDPfmValidationCounters;
268283
}
269284
def : PfmCountersBinding<"znver1", ZnVer1PfmCounters>;
270285

@@ -275,9 +290,7 @@ def ZnVer2PfmCounters : ProcPfmCounters {
275290
PfmIssueCounter<"Zn2AGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">,
276291
PfmIssueCounter<"Zn2Divider", "div_op_count">
277292
];
278-
let ValidationCounters = [
279-
PfmValidationCounter<InstructionRetired, "RETIRED_INSTRUCTIONS">
280-
];
293+
let ValidationCounters = DefaultAMDPfmValidationCounters;
281294
}
282295
def : PfmCountersBinding<"znver2", ZnVer2PfmCounters>;
283296

@@ -291,9 +304,7 @@ def ZnVer3PfmCounters : ProcPfmCounters {
291304
PfmIssueCounter<"Zn3Store", "ls_dispatch:store_dispatch">,
292305
PfmIssueCounter<"Zn3Divider", "div_op_count">
293306
];
294-
let ValidationCounters = [
295-
PfmValidationCounter<InstructionRetired, "RETIRED_INSTRUCTIONS">
296-
];
307+
let ValidationCounters = DefaultAMDPfmValidationCounters;
297308
}
298309
def : PfmCountersBinding<"znver3", ZnVer3PfmCounters>;
299310

@@ -308,5 +319,6 @@ def ZnVer4PfmCounters : ProcPfmCounters {
308319
PfmIssueCounter<"Zn4Divider", "div_op_count">,
309320
PfmIssueCounter<"Zn4AGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">
310321
];
322+
let ValidationCounters = DefaultAMDPfmValidationCounters;
311323
}
312324
def : PfmCountersBinding<"znver4", ZnVer4PfmCounters>;

0 commit comments

Comments
 (0)