Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 1 | //===-- 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 Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 14 | def UnhaltedCoreCyclesPfmCounter : PfmCounter<"unhalted_core_cycles">; |
| 15 | def UopsIssuedPfmCounter : PfmCounter<"uops_issued:any">; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 16 | |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 17 | // No default counters on X86. |
| 18 | def DefaultPfmCounters : ProcPfmCounters {} |
| 19 | def : PfmCountersDefaultBinding<DefaultPfmCounters>; |
| 20 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 21 | def 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 Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 31 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 32 | def : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>; |
Simon Pilgrim | 9c7d85b | 2018-12-07 09:27:35 +0000 | [diff] [blame^] | 33 | def : PfmCountersBinding<"ivybridge", SandyBridgePfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 34 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 35 | def 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 Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 48 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 49 | def : PfmCountersBinding<"haswell", HaswellPfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 50 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 51 | def 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 Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 64 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 65 | def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 66 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 67 | def 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 Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 80 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 81 | def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>; |
Simon Pilgrim | a90c211 | 2018-05-24 14:54:32 +0000 | [diff] [blame] | 82 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 83 | def 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 Pilgrim | a90c211 | 2018-05-24 14:54:32 +0000 | [diff] [blame] | 96 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 97 | def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>; |
| 98 | |
Roman Lebedev | a5baf86 | 2018-10-27 20:46:30 +0000 | [diff] [blame] | 99 | def 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 | } |
| 109 | def : PfmCountersBinding<"bdver2", BdVer2PfmCounters>; |
| 110 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 111 | def 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 | } |
| 119 | def : PfmCountersBinding<"btver2", BtVer2PfmCounters>; |