@@ -18,6 +18,10 @@ def DefaultPfmCounters : ProcPfmCounters {}
1818def : PfmCountersDefaultBinding<DefaultPfmCounters>;
1919
2020// Intel X86 Counters.
21+ defvar DefaultIntelPfmValidationCounters = [
22+ PfmValidationCounter<InstructionRetired, "INSTRUCTIONS_RETIRED">
23+ ];
24+
2125def 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}
104109def : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>;
105110def : 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}
121127def : 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}
137144def : 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}
153161def : 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}
169178def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
170179def : 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}
186196def : PfmCountersBinding<"icelake-client", IceLakePfmCounters>;
187197def : PfmCountersBinding<"icelake-server", IceLakePfmCounters>;
188198def : PfmCountersBinding<"rocketlake", IceLakePfmCounters>;
189199def : 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.
193207def 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}
269284def : 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}
282295def : 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}
298309def : 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}
312324def : PfmCountersBinding<"znver4", ZnVer4PfmCounters>;
0 commit comments