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 | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 17 | def SandyBridgePfmCounters : ProcPfmCounters { |
| 18 | let CycleCounter = UnhaltedCoreCyclesPfmCounter; |
| 19 | let UopsCounter = UopsIssuedPfmCounter; |
| 20 | let IssueCounters = [ |
| 21 | PfmIssueCounter<"SBPort0", "uops_dispatched_port:port_0">, |
| 22 | PfmIssueCounter<"SBPort1", "uops_dispatched_port:port_1">, |
| 23 | PfmIssueCounter<"SBPort23", "uops_dispatched_port:port_2 + uops_dispatched_port:port_3">, |
| 24 | PfmIssueCounter<"SBPort4", "uops_dispatched_port:port_4">, |
| 25 | PfmIssueCounter<"SBPort5", "uops_dispatched_port:port_5"> |
| 26 | ]; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 27 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 28 | def : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 29 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 30 | def HaswellPfmCounters : ProcPfmCounters { |
| 31 | let CycleCounter = UnhaltedCoreCyclesPfmCounter; |
| 32 | let UopsCounter = UopsIssuedPfmCounter; |
| 33 | let IssueCounters = [ |
| 34 | PfmIssueCounter<"HWPort0", "uops_dispatched_port:port_0">, |
| 35 | PfmIssueCounter<"HWPort1", "uops_dispatched_port:port_1">, |
| 36 | PfmIssueCounter<"HWPort2", "uops_dispatched_port:port_2">, |
| 37 | PfmIssueCounter<"HWPort3", "uops_dispatched_port:port_3">, |
| 38 | PfmIssueCounter<"HWPort4", "uops_dispatched_port:port_4">, |
| 39 | PfmIssueCounter<"HWPort5", "uops_dispatched_port:port_5">, |
| 40 | PfmIssueCounter<"HWPort6", "uops_dispatched_port:port_6">, |
| 41 | PfmIssueCounter<"HWPort7", "uops_dispatched_port:port_7"> |
| 42 | ]; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 43 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 44 | def : PfmCountersBinding<"haswell", HaswellPfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 45 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 46 | def BroadwellPfmCounters : ProcPfmCounters { |
| 47 | let CycleCounter = UnhaltedCoreCyclesPfmCounter; |
| 48 | let UopsCounter = UopsIssuedPfmCounter; |
| 49 | let IssueCounters = [ |
| 50 | PfmIssueCounter<"BWPort0", "uops_executed_port:port_0">, |
| 51 | PfmIssueCounter<"BWPort1", "uops_executed_port:port_1">, |
| 52 | PfmIssueCounter<"BWPort2", "uops_executed_port:port_2">, |
| 53 | PfmIssueCounter<"BWPort3", "uops_executed_port:port_3">, |
| 54 | PfmIssueCounter<"BWPort4", "uops_executed_port:port_4">, |
| 55 | PfmIssueCounter<"BWPort5", "uops_executed_port:port_5">, |
| 56 | PfmIssueCounter<"BWPort6", "uops_executed_port:port_6">, |
| 57 | PfmIssueCounter<"BWPort7", "uops_executed_port:port_7"> |
| 58 | ]; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 59 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 60 | def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 61 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 62 | def SkylakeClientPfmCounters : ProcPfmCounters { |
| 63 | let CycleCounter = UnhaltedCoreCyclesPfmCounter; |
| 64 | let UopsCounter = UopsIssuedPfmCounter; |
| 65 | let IssueCounters = [ |
| 66 | PfmIssueCounter<"SKLPort0", "uops_dispatched_port:port_0">, |
| 67 | PfmIssueCounter<"SKLPort1", "uops_dispatched_port:port_1">, |
| 68 | PfmIssueCounter<"SKLPort2", "uops_dispatched_port:port_2">, |
| 69 | PfmIssueCounter<"SKLPort3", "uops_dispatched_port:port_3">, |
| 70 | PfmIssueCounter<"SKLPort4", "uops_dispatched_port:port_4">, |
| 71 | PfmIssueCounter<"SKLPort5", "uops_dispatched_port:port_5">, |
| 72 | PfmIssueCounter<"SKLPort6", "uops_dispatched_port:port_6">, |
| 73 | PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7"> |
| 74 | ]; |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 75 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 76 | def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>; |
Simon Pilgrim | a90c211 | 2018-05-24 14:54:32 +0000 | [diff] [blame] | 77 | |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 78 | def SkylakeServerPfmCounters : ProcPfmCounters { |
| 79 | let CycleCounter = UnhaltedCoreCyclesPfmCounter; |
| 80 | let UopsCounter = UopsIssuedPfmCounter; |
| 81 | let IssueCounters = [ |
| 82 | PfmIssueCounter<"SKXPort0", "uops_dispatched_port:port_0">, |
| 83 | PfmIssueCounter<"SKXPort1", "uops_dispatched_port:port_1">, |
| 84 | PfmIssueCounter<"SKXPort2", "uops_dispatched_port:port_2">, |
| 85 | PfmIssueCounter<"SKXPort3", "uops_dispatched_port:port_3">, |
| 86 | PfmIssueCounter<"SKXPort4", "uops_dispatched_port:port_4">, |
| 87 | PfmIssueCounter<"SKXPort5", "uops_dispatched_port:port_5">, |
| 88 | PfmIssueCounter<"SKXPort6", "uops_dispatched_port:port_6">, |
| 89 | PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7"> |
| 90 | ]; |
Simon Pilgrim | a90c211 | 2018-05-24 14:54:32 +0000 | [diff] [blame] | 91 | } |
Clement Courbet | 41c8af3 | 2018-10-25 07:44:01 +0000 | [diff] [blame^] | 92 | def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>; |
| 93 | |
| 94 | def BtVer2PfmCounters : ProcPfmCounters { |
| 95 | let CycleCounter = PfmCounter<"cpu_clk_unhalted">; |
| 96 | let UopsCounter = PfmCounter<"retired_uops">; |
| 97 | let IssueCounters = [ |
| 98 | PfmIssueCounter<"JFPU0", "dispatched_fpu:pipe0">, |
| 99 | PfmIssueCounter<"JFPU1", "dispatched_fpu:pipe1"> |
| 100 | ]; |
| 101 | } |
| 102 | def : PfmCountersBinding<"btver2", BtVer2PfmCounters>; |