LLVM  12.0.0git
MBFIWrapper.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/MBFIWrapper.h -------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This class keeps track of branch frequencies of newly created blocks and
10 // tail-merged blocks. Used by the TailDuplication and MachineBlockPlacement.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MBFIWRAPPER_H
15 #define LLVM_CODEGEN_MBFIWRAPPER_H
16 
17 #include "llvm/ADT/DenseMap.h"
19 
20 namespace llvm {
21 
22 class MachineBasicBlock;
23 class MachineBlockFrequencyInfo;
24 
25 class MBFIWrapper {
26  public:
28 
32  const MachineBasicBlock *MBB) const;
34  const BlockFrequency Freq) const;
35  void view(const Twine &Name, bool isSimple = true);
36  uint64_t getEntryFreq() const;
37  const MachineBlockFrequencyInfo &getMBFI() { return MBFI; }
38 
39  private:
40  const MachineBlockFrequencyInfo &MBFI;
42 };
43 
44 } // end namespace llvm
45 
46 #endif // LLVM_CODEGEN_MBFIWRAPPER_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
F(f)
void view(const Twine &Name, bool isSimple=true)
Definition: MBFIWrapper.cpp:43
MBFIWrapper(const MachineBlockFrequencyInfo &I)
Definition: MBFIWrapper.h:27
MachineBasicBlock & MBB
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
static bool isSimple(Instruction *I)
void setBlockFreq(const MachineBasicBlock *MBB, BlockFrequency F)
Definition: MBFIWrapper.cpp:28
uint64_t getEntryFreq() const
Definition: MBFIWrapper.cpp:47
BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const
Definition: MBFIWrapper.cpp:19
const MachineBlockFrequencyInfo & getMBFI()
Definition: MBFIWrapper.h:37
raw_ostream & printBlockFreq(raw_ostream &OS, const MachineBasicBlock *MBB) const
Definition: MBFIWrapper.cpp:33
#define I(x, y, z)
Definition: MD5.cpp:59
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46