Duncan P. N. Exon Smith | 689a507 | 2014-04-11 23:20:58 +0000 | [diff] [blame] | 1 | //===- MachineBlockFrequencyInfo.cpp - MBB Frequency Analysis -------------===// |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 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 | // Loops should be simplified before this analysis. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 14 | #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" |
Duncan P. N. Exon Smith | 689a507 | 2014-04-11 23:20:58 +0000 | [diff] [blame] | 15 | #include "llvm/Analysis/BlockFrequencyInfoImpl.h" |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 16 | #include "llvm/CodeGen/MachineBranchProbabilityInfo.h" |
Duncan P. N. Exon Smith | 10be9a8 | 2014-04-21 17:57:07 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/MachineFunction.h" |
| 18 | #include "llvm/CodeGen/MachineLoopInfo.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/Passes.h" |
| 20 | #include "llvm/InitializePasses.h" |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 21 | #include "llvm/Support/CommandLine.h" |
| 22 | #include "llvm/Support/Debug.h" |
Xinliang David Li | 69317f2 | 2016-06-22 16:04:51 +0000 | [diff] [blame] | 23 | #include "llvm/Support/Format.h" |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 24 | #include "llvm/Support/GraphWriter.h" |
Xinliang David Li | 69317f2 | 2016-06-22 16:04:51 +0000 | [diff] [blame] | 25 | #include "llvm/Support/raw_ostream.h" |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 26 | |
| 27 | using namespace llvm; |
| 28 | |
Chandler Carruth | 1b9dde0 | 2014-04-22 02:02:50 +0000 | [diff] [blame] | 29 | #define DEBUG_TYPE "block-freq" |
| 30 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 31 | |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 32 | static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG( |
| 33 | "view-machine-block-freq-propagation-dags", cl::Hidden, |
| 34 | cl::desc("Pop up a window to show a dag displaying how machine block " |
| 35 | "frequencies propagate through the CFG."), |
| 36 | cl::values(clEnumValN(GVDT_None, "none", "do not display graphs."), |
| 37 | clEnumValN(GVDT_Fraction, "fraction", |
| 38 | "display a graph using the " |
| 39 | "fractional block frequency representation."), |
| 40 | clEnumValN(GVDT_Integer, "integer", |
| 41 | "display a graph using the raw " |
| 42 | "integer fractional block frequency representation."), |
Xinliang David Li | 30c50f3 | 2016-06-22 19:26:44 +0000 | [diff] [blame] | 43 | clEnumValN(GVDT_Count, "count", "display a graph using the real " |
Mehdi Amini | 732afdd | 2016-10-08 19:41:06 +0000 | [diff] [blame] | 44 | "profile count if available."))); |
Xinliang David Li | fd3f645 | 2017-01-29 01:57:02 +0000 | [diff] [blame] | 45 | // Similar option above, but used to control BFI display only after MBP pass |
| 46 | cl::opt<GVDAGType> ViewBlockLayoutWithBFI( |
| 47 | "view-block-layout-with-bfi", cl::Hidden, |
| 48 | cl::desc( |
| 49 | "Pop up a window to show a dag displaying MBP layout and associated " |
| 50 | "block frequencies of the CFG."), |
| 51 | cl::values(clEnumValN(GVDT_None, "none", "do not display graphs."), |
| 52 | clEnumValN(GVDT_Fraction, "fraction", |
| 53 | "display a graph using the " |
| 54 | "fractional block frequency representation."), |
| 55 | clEnumValN(GVDT_Integer, "integer", |
| 56 | "display a graph using the raw " |
| 57 | "integer fractional block frequency representation."), |
| 58 | clEnumValN(GVDT_Count, "count", |
| 59 | "display a graph using the real " |
| 60 | "profile count if available."))); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 61 | |
Xinliang David Li | 58fcc9b | 2017-02-02 21:29:17 +0000 | [diff] [blame] | 62 | // Command line option to specify the name of the function for CFG dump |
| 63 | // Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name= |
Xinliang David Li | 8dd5ce9 | 2016-06-28 04:07:03 +0000 | [diff] [blame] | 64 | extern cl::opt<std::string> ViewBlockFreqFuncName; |
Xinliang David Li | 58fcc9b | 2017-02-02 21:29:17 +0000 | [diff] [blame] | 65 | // Command line option to specify hot frequency threshold. |
| 66 | // Defined in Analysis/BlockFrequencyInfo.cpp: -view-hot-freq-perc= |
Simon Pilgrim | 2d53158 | 2016-06-28 12:34:44 +0000 | [diff] [blame] | 67 | extern cl::opt<unsigned> ViewHotFreqPercent; |
Xinliang David Li | 80457ce | 2016-06-22 02:12:54 +0000 | [diff] [blame] | 68 | |
Xinliang David Li | fd3f645 | 2017-01-29 01:57:02 +0000 | [diff] [blame] | 69 | static GVDAGType getGVDT() { |
| 70 | if (ViewBlockLayoutWithBFI != GVDT_None) |
| 71 | return ViewBlockLayoutWithBFI; |
| 72 | |
| 73 | return ViewMachineBlockFreqPropagationDAG; |
| 74 | } |
| 75 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 76 | namespace llvm { |
| 77 | |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 78 | template <> struct GraphTraits<MachineBlockFrequencyInfo *> { |
Tim Shen | eb3958f | 2016-08-17 20:07:29 +0000 | [diff] [blame] | 79 | typedef const MachineBasicBlock *NodeRef; |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 80 | typedef MachineBasicBlock::const_succ_iterator ChildIteratorType; |
Tim Shen | b5e0f5a | 2016-08-19 21:20:13 +0000 | [diff] [blame] | 81 | typedef pointer_iterator<MachineFunction::const_iterator> nodes_iterator; |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 82 | |
Tim Shen | 48f814e | 2016-08-31 16:48:13 +0000 | [diff] [blame] | 83 | static NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) { |
Duncan P. N. Exon Smith | 0ac8eb9 | 2015-10-09 19:23:20 +0000 | [diff] [blame] | 84 | return &G->getFunction()->front(); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 85 | } |
Michael Gottesman | 748fe48 | 2013-12-03 20:21:17 +0000 | [diff] [blame] | 86 | |
Tim Shen | f2187ed | 2016-08-22 21:09:30 +0000 | [diff] [blame] | 87 | static ChildIteratorType child_begin(const NodeRef N) { |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 88 | return N->succ_begin(); |
| 89 | } |
Michael Gottesman | 748fe48 | 2013-12-03 20:21:17 +0000 | [diff] [blame] | 90 | |
Tim Shen | f2187ed | 2016-08-22 21:09:30 +0000 | [diff] [blame] | 91 | static ChildIteratorType child_end(const NodeRef N) { return N->succ_end(); } |
Michael Gottesman | 748fe48 | 2013-12-03 20:21:17 +0000 | [diff] [blame] | 92 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 93 | static nodes_iterator nodes_begin(const MachineBlockFrequencyInfo *G) { |
Tim Shen | b5e0f5a | 2016-08-19 21:20:13 +0000 | [diff] [blame] | 94 | return nodes_iterator(G->getFunction()->begin()); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 95 | } |
Michael Gottesman | 748fe48 | 2013-12-03 20:21:17 +0000 | [diff] [blame] | 96 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 97 | static nodes_iterator nodes_end(const MachineBlockFrequencyInfo *G) { |
Tim Shen | b5e0f5a | 2016-08-19 21:20:13 +0000 | [diff] [blame] | 98 | return nodes_iterator(G->getFunction()->end()); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 99 | } |
| 100 | }; |
| 101 | |
Xinliang David Li | 55415f2 | 2016-06-28 03:41:29 +0000 | [diff] [blame] | 102 | typedef BFIDOTGraphTraitsBase<MachineBlockFrequencyInfo, |
| 103 | MachineBranchProbabilityInfo> |
| 104 | MBFIDOTGraphTraitsBase; |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 105 | template <> |
| 106 | struct DOTGraphTraits<MachineBlockFrequencyInfo *> |
Xinliang David Li | 55415f2 | 2016-06-28 03:41:29 +0000 | [diff] [blame] | 107 | : public MBFIDOTGraphTraitsBase { |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 108 | explicit DOTGraphTraits(bool isSimple = false) |
Xinliang David Li | fd3f645 | 2017-01-29 01:57:02 +0000 | [diff] [blame] | 109 | : MBFIDOTGraphTraitsBase(isSimple), CurFunc(nullptr), LayoutOrderMap() {} |
| 110 | |
| 111 | const MachineFunction *CurFunc; |
| 112 | DenseMap<const MachineBasicBlock *, int> LayoutOrderMap; |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 113 | |
| 114 | std::string getNodeLabel(const MachineBasicBlock *Node, |
| 115 | const MachineBlockFrequencyInfo *Graph) { |
Xinliang David Li | fd3f645 | 2017-01-29 01:57:02 +0000 | [diff] [blame] | 116 | |
| 117 | int layout_order = -1; |
| 118 | // Attach additional ordering information if 'isSimple' is false. |
| 119 | if (!isSimple()) { |
| 120 | const MachineFunction *F = Node->getParent(); |
| 121 | if (!CurFunc || F != CurFunc) { |
| 122 | if (CurFunc) |
| 123 | LayoutOrderMap.clear(); |
| 124 | |
| 125 | CurFunc = F; |
| 126 | int O = 0; |
| 127 | for (auto MBI = F->begin(); MBI != F->end(); ++MBI, ++O) { |
| 128 | LayoutOrderMap[&*MBI] = O; |
| 129 | } |
| 130 | } |
| 131 | layout_order = LayoutOrderMap[Node]; |
| 132 | } |
| 133 | return MBFIDOTGraphTraitsBase::getNodeLabel(Node, Graph, getGVDT(), |
| 134 | layout_order); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 135 | } |
Xinliang David Li | 55415f2 | 2016-06-28 03:41:29 +0000 | [diff] [blame] | 136 | |
Xinliang David Li | 3e176c7 | 2016-06-28 06:58:21 +0000 | [diff] [blame] | 137 | std::string getNodeAttributes(const MachineBasicBlock *Node, |
| 138 | const MachineBlockFrequencyInfo *Graph) { |
| 139 | return MBFIDOTGraphTraitsBase::getNodeAttributes(Node, Graph, |
| 140 | ViewHotFreqPercent); |
| 141 | } |
| 142 | |
Xinliang David Li | 55415f2 | 2016-06-28 03:41:29 +0000 | [diff] [blame] | 143 | std::string getEdgeAttributes(const MachineBasicBlock *Node, EdgeIter EI, |
| 144 | const MachineBlockFrequencyInfo *MBFI) { |
Xinliang David Li | 3e176c7 | 2016-06-28 06:58:21 +0000 | [diff] [blame] | 145 | return MBFIDOTGraphTraitsBase::getEdgeAttributes( |
| 146 | Node, EI, MBFI, MBFI->getMBPI(), ViewHotFreqPercent); |
Xinliang David Li | 69317f2 | 2016-06-22 16:04:51 +0000 | [diff] [blame] | 147 | } |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 148 | }; |
| 149 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 150 | } // end namespace llvm |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 151 | |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 152 | INITIALIZE_PASS_BEGIN(MachineBlockFrequencyInfo, "machine-block-freq", |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 153 | "Machine Block Frequency Analysis", true, true) |
| 154 | INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo) |
Duncan P. N. Exon Smith | 10be9a8 | 2014-04-21 17:57:07 +0000 | [diff] [blame] | 155 | INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo) |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 156 | INITIALIZE_PASS_END(MachineBlockFrequencyInfo, "machine-block-freq", |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 157 | "Machine Block Frequency Analysis", true, true) |
| 158 | |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 159 | char MachineBlockFrequencyInfo::ID = 0; |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 160 | |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 161 | MachineBlockFrequencyInfo::MachineBlockFrequencyInfo() |
| 162 | : MachineFunctionPass(ID) { |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 163 | initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry()); |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 164 | } |
| 165 | |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 166 | MachineBlockFrequencyInfo::~MachineBlockFrequencyInfo() {} |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 167 | |
Jakub Staszak | 875ebd5 | 2011-07-25 19:25:40 +0000 | [diff] [blame] | 168 | void MachineBlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const { |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 169 | AU.addRequired<MachineBranchProbabilityInfo>(); |
Duncan P. N. Exon Smith | 10be9a8 | 2014-04-21 17:57:07 +0000 | [diff] [blame] | 170 | AU.addRequired<MachineLoopInfo>(); |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 171 | AU.setPreservesAll(); |
Jakub Staszak | cb7c0a4 | 2011-07-21 22:59:09 +0000 | [diff] [blame] | 172 | MachineFunctionPass::getAnalysisUsage(AU); |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 173 | } |
| 174 | |
Adam Nemet | bbb141c | 2017-02-14 17:21:09 +0000 | [diff] [blame] | 175 | void MachineBlockFrequencyInfo::calculate( |
| 176 | const MachineFunction &F, const MachineBranchProbabilityInfo &MBPI, |
| 177 | const MachineLoopInfo &MLI) { |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 178 | if (!MBFI) |
| 179 | MBFI.reset(new ImplType); |
Cong Hou | 5e67b66 | 2015-07-15 19:58:26 +0000 | [diff] [blame] | 180 | MBFI->calculate(F, MBPI, MLI); |
Xinliang David Li | 80457ce | 2016-06-22 02:12:54 +0000 | [diff] [blame] | 181 | if (ViewMachineBlockFreqPropagationDAG != GVDT_None && |
Xinliang David Li | 8dd5ce9 | 2016-06-28 04:07:03 +0000 | [diff] [blame] | 182 | (ViewBlockFreqFuncName.empty() || |
| 183 | F.getName().equals(ViewBlockFreqFuncName))) { |
Xinliang David Li | 538d666 | 2017-02-15 19:21:04 +0000 | [diff] [blame^] | 184 | view("MachineBlockFrequencyDAGS." + F.getName()); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 185 | } |
Adam Nemet | bbb141c | 2017-02-14 17:21:09 +0000 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) { |
| 189 | MachineBranchProbabilityInfo &MBPI = |
| 190 | getAnalysis<MachineBranchProbabilityInfo>(); |
| 191 | MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>(); |
| 192 | calculate(F, MBPI, MLI); |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 193 | return false; |
| 194 | } |
| 195 | |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 196 | void MachineBlockFrequencyInfo::releaseMemory() { MBFI.reset(); } |
| 197 | |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 198 | /// Pop up a ghostview window with the current block frequency propagation |
| 199 | /// rendered using dot. |
Xinliang David Li | 538d666 | 2017-02-15 19:21:04 +0000 | [diff] [blame^] | 200 | void MachineBlockFrequencyInfo::view(const Twine &Name, bool isSimple) const { |
| 201 | // This code is only for debugging. |
| 202 | ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this), Name, isSimple); |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 203 | } |
| 204 | |
Xinliang David Li | bc15708 | 2016-06-21 23:36:12 +0000 | [diff] [blame] | 205 | BlockFrequency |
| 206 | MachineBlockFrequencyInfo::getBlockFreq(const MachineBasicBlock *MBB) const { |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 207 | return MBFI ? MBFI->getBlockFreq(MBB) : 0; |
Jakub Staszak | 2713117 | 2011-07-16 20:23:20 +0000 | [diff] [blame] | 208 | } |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 209 | |
Xinliang David Li | 30c50f3 | 2016-06-22 19:26:44 +0000 | [diff] [blame] | 210 | Optional<uint64_t> MachineBlockFrequencyInfo::getBlockProfileCount( |
| 211 | const MachineBasicBlock *MBB) const { |
| 212 | const Function *F = MBFI->getFunction()->getFunction(); |
| 213 | return MBFI ? MBFI->getBlockProfileCount(*F, MBB) : None; |
| 214 | } |
| 215 | |
Sean Silva | f801575 | 2016-08-02 02:15:45 +0000 | [diff] [blame] | 216 | Optional<uint64_t> |
| 217 | MachineBlockFrequencyInfo::getProfileCountFromFreq(uint64_t Freq) const { |
| 218 | const Function *F = MBFI->getFunction()->getFunction(); |
| 219 | return MBFI ? MBFI->getProfileCountFromFreq(*F, Freq) : None; |
| 220 | } |
| 221 | |
Duncan P. N. Exon Smith | 936aef9 | 2014-03-25 18:01:32 +0000 | [diff] [blame] | 222 | const MachineFunction *MachineBlockFrequencyInfo::getFunction() const { |
Duncan P. N. Exon Smith | 10be9a8 | 2014-04-21 17:57:07 +0000 | [diff] [blame] | 223 | return MBFI ? MBFI->getFunction() : nullptr; |
Michael Gottesman | 65bbcdf | 2013-12-03 00:49:33 +0000 | [diff] [blame] | 224 | } |
Michael Gottesman | fd5c4b2 | 2013-12-14 00:06:03 +0000 | [diff] [blame] | 225 | |
Xinliang David Li | 3264fdd | 2016-06-28 00:15:45 +0000 | [diff] [blame] | 226 | const MachineBranchProbabilityInfo *MachineBlockFrequencyInfo::getMBPI() const { |
| 227 | return MBFI ? &MBFI->getBPI() : nullptr; |
| 228 | } |
| 229 | |
Michael Gottesman | fd5c4b2 | 2013-12-14 00:06:03 +0000 | [diff] [blame] | 230 | raw_ostream & |
| 231 | MachineBlockFrequencyInfo::printBlockFreq(raw_ostream &OS, |
| 232 | const BlockFrequency Freq) const { |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 233 | return MBFI ? MBFI->printBlockFreq(OS, Freq) : OS; |
Michael Gottesman | fd5c4b2 | 2013-12-14 00:06:03 +0000 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | raw_ostream & |
| 237 | MachineBlockFrequencyInfo::printBlockFreq(raw_ostream &OS, |
| 238 | const MachineBasicBlock *MBB) const { |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 239 | return MBFI ? MBFI->printBlockFreq(OS, MBB) : OS; |
Michael Gottesman | fd5c4b2 | 2013-12-14 00:06:03 +0000 | [diff] [blame] | 240 | } |
| 241 | |
Michael Gottesman | 5e985ee | 2013-12-14 02:37:38 +0000 | [diff] [blame] | 242 | uint64_t MachineBlockFrequencyInfo::getEntryFreq() const { |
Duncan P. N. Exon Smith | 3dbe105 | 2014-03-25 18:01:38 +0000 | [diff] [blame] | 243 | return MBFI ? MBFI->getEntryFreq() : 0; |
Michael Gottesman | fd5c4b2 | 2013-12-14 00:06:03 +0000 | [diff] [blame] | 244 | } |