blob: e453b0fee1c652e1f685ff9c7f953ddaa9b1a287 [file] [log] [blame]
Clement Courbetb4493792018-04-10 08:16:37 +00001//===-- X86PfmCounters.td - X86 Hardware Counters ----------*- tablegen -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This describes the available hardware counters for various subtargets.
11//
12//===----------------------------------------------------------------------===//
13
Clement Courbet41c8af32018-10-25 07:44:01 +000014def UnhaltedCoreCyclesPfmCounter : PfmCounter<"unhalted_core_cycles">;
15def UopsIssuedPfmCounter : PfmCounter<"uops_issued:any">;
Clement Courbetb4493792018-04-10 08:16:37 +000016
Clement Courbeteee2e062018-11-09 13:15:32 +000017// No default counters on X86.
18def DefaultPfmCounters : ProcPfmCounters {}
19def : PfmCountersDefaultBinding<DefaultPfmCounters>;
20
Clement Courbet41c8af32018-10-25 07:44:01 +000021def SandyBridgePfmCounters : ProcPfmCounters {
22 let CycleCounter = UnhaltedCoreCyclesPfmCounter;
23 let UopsCounter = UopsIssuedPfmCounter;
24 let IssueCounters = [
25 PfmIssueCounter<"SBPort0", "uops_dispatched_port:port_0">,
26 PfmIssueCounter<"SBPort1", "uops_dispatched_port:port_1">,
27 PfmIssueCounter<"SBPort23", "uops_dispatched_port:port_2 + uops_dispatched_port:port_3">,
28 PfmIssueCounter<"SBPort4", "uops_dispatched_port:port_4">,
29 PfmIssueCounter<"SBPort5", "uops_dispatched_port:port_5">
30 ];
Clement Courbetb4493792018-04-10 08:16:37 +000031}
Clement Courbet41c8af32018-10-25 07:44:01 +000032def : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>;
Simon Pilgrim9c7d85b2018-12-07 09:27:35 +000033def : PfmCountersBinding<"ivybridge", SandyBridgePfmCounters>;
Clement Courbetb4493792018-04-10 08:16:37 +000034
Clement Courbet41c8af32018-10-25 07:44:01 +000035def HaswellPfmCounters : ProcPfmCounters {
36 let CycleCounter = UnhaltedCoreCyclesPfmCounter;
37 let UopsCounter = UopsIssuedPfmCounter;
38 let IssueCounters = [
39 PfmIssueCounter<"HWPort0", "uops_dispatched_port:port_0">,
40 PfmIssueCounter<"HWPort1", "uops_dispatched_port:port_1">,
41 PfmIssueCounter<"HWPort2", "uops_dispatched_port:port_2">,
42 PfmIssueCounter<"HWPort3", "uops_dispatched_port:port_3">,
43 PfmIssueCounter<"HWPort4", "uops_dispatched_port:port_4">,
44 PfmIssueCounter<"HWPort5", "uops_dispatched_port:port_5">,
45 PfmIssueCounter<"HWPort6", "uops_dispatched_port:port_6">,
46 PfmIssueCounter<"HWPort7", "uops_dispatched_port:port_7">
47 ];
Clement Courbetb4493792018-04-10 08:16:37 +000048}
Clement Courbet41c8af32018-10-25 07:44:01 +000049def : PfmCountersBinding<"haswell", HaswellPfmCounters>;
Clement Courbetb4493792018-04-10 08:16:37 +000050
Clement Courbet41c8af32018-10-25 07:44:01 +000051def BroadwellPfmCounters : ProcPfmCounters {
52 let CycleCounter = UnhaltedCoreCyclesPfmCounter;
53 let UopsCounter = UopsIssuedPfmCounter;
54 let IssueCounters = [
55 PfmIssueCounter<"BWPort0", "uops_executed_port:port_0">,
56 PfmIssueCounter<"BWPort1", "uops_executed_port:port_1">,
57 PfmIssueCounter<"BWPort2", "uops_executed_port:port_2">,
58 PfmIssueCounter<"BWPort3", "uops_executed_port:port_3">,
59 PfmIssueCounter<"BWPort4", "uops_executed_port:port_4">,
60 PfmIssueCounter<"BWPort5", "uops_executed_port:port_5">,
61 PfmIssueCounter<"BWPort6", "uops_executed_port:port_6">,
62 PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
63 ];
Clement Courbetb4493792018-04-10 08:16:37 +000064}
Clement Courbet41c8af32018-10-25 07:44:01 +000065def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
Clement Courbetb4493792018-04-10 08:16:37 +000066
Clement Courbet41c8af32018-10-25 07:44:01 +000067def SkylakeClientPfmCounters : ProcPfmCounters {
68 let CycleCounter = UnhaltedCoreCyclesPfmCounter;
69 let UopsCounter = UopsIssuedPfmCounter;
70 let IssueCounters = [
71 PfmIssueCounter<"SKLPort0", "uops_dispatched_port:port_0">,
72 PfmIssueCounter<"SKLPort1", "uops_dispatched_port:port_1">,
73 PfmIssueCounter<"SKLPort2", "uops_dispatched_port:port_2">,
74 PfmIssueCounter<"SKLPort3", "uops_dispatched_port:port_3">,
75 PfmIssueCounter<"SKLPort4", "uops_dispatched_port:port_4">,
76 PfmIssueCounter<"SKLPort5", "uops_dispatched_port:port_5">,
77 PfmIssueCounter<"SKLPort6", "uops_dispatched_port:port_6">,
78 PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
79 ];
Clement Courbetb4493792018-04-10 08:16:37 +000080}
Clement Courbet41c8af32018-10-25 07:44:01 +000081def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
Simon Pilgrima90c2112018-05-24 14:54:32 +000082
Clement Courbet41c8af32018-10-25 07:44:01 +000083def SkylakeServerPfmCounters : ProcPfmCounters {
84 let CycleCounter = UnhaltedCoreCyclesPfmCounter;
85 let UopsCounter = UopsIssuedPfmCounter;
86 let IssueCounters = [
87 PfmIssueCounter<"SKXPort0", "uops_dispatched_port:port_0">,
88 PfmIssueCounter<"SKXPort1", "uops_dispatched_port:port_1">,
89 PfmIssueCounter<"SKXPort2", "uops_dispatched_port:port_2">,
90 PfmIssueCounter<"SKXPort3", "uops_dispatched_port:port_3">,
91 PfmIssueCounter<"SKXPort4", "uops_dispatched_port:port_4">,
92 PfmIssueCounter<"SKXPort5", "uops_dispatched_port:port_5">,
93 PfmIssueCounter<"SKXPort6", "uops_dispatched_port:port_6">,
94 PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
95 ];
Simon Pilgrima90c2112018-05-24 14:54:32 +000096}
Clement Courbet41c8af32018-10-25 07:44:01 +000097def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
98
Roman Lebedeva5baf862018-10-27 20:46:30 +000099def BdVer2PfmCounters : ProcPfmCounters {
100 let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
101 let UopsCounter = PfmCounter<"retired_uops">;
102 let IssueCounters = [
103 PfmIssueCounter<"PdFPU0", "dispatched_fpu_ops:ops_pipe0 + dispatched_fpu_ops:ops_dual_pipe0">,
104 PfmIssueCounter<"PdFPU1", "dispatched_fpu_ops:ops_pipe1 + dispatched_fpu_ops:ops_dual_pipe1">,
105 PfmIssueCounter<"PdFPU2", "dispatched_fpu_ops:ops_pipe2 + dispatched_fpu_ops:ops_dual_pipe2">,
106 PfmIssueCounter<"PdFPU3", "dispatched_fpu_ops:ops_pipe3 + dispatched_fpu_ops:ops_dual_pipe3">
107 ];
108}
109def : PfmCountersBinding<"bdver2", BdVer2PfmCounters>;
110
Clement Courbet41c8af32018-10-25 07:44:01 +0000111def BtVer2PfmCounters : ProcPfmCounters {
112 let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
113 let UopsCounter = PfmCounter<"retired_uops">;
114 let IssueCounters = [
115 PfmIssueCounter<"JFPU0", "dispatched_fpu:pipe0">,
116 PfmIssueCounter<"JFPU1", "dispatched_fpu:pipe1">
117 ];
118}
119def : PfmCountersBinding<"btver2", BtVer2PfmCounters>;