LLVM 19.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#include <optional>
20
21namespace llvm {
22
23class MachineBasicBlock;
24class MachineBlockFrequencyInfo;
25
27 public:
29
32 std::optional<uint64_t>
34
35 void view(const Twine &Name, bool isSimple = true);
37 const MachineBlockFrequencyInfo &getMBFI() const { return MBFI; }
38
39private:
40 const MachineBlockFrequencyInfo &MBFI;
42};
43
44} // end namespace llvm
45
46#endif // LLVM_CODEGEN_MBFIWRAPPER_H
MachineBasicBlock & MBB
This file defines the DenseMap class.
std::string Name
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
static bool isSimple(Instruction *I)
std::optional< uint64_t > getBlockProfileCount(const MachineBasicBlock *MBB) const
Definition: MBFIWrapper.cpp:35
BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const
Definition: MBFIWrapper.cpp:20
void view(const Twine &Name, bool isSimple=true)
Definition: MBFIWrapper.cpp:46
void setBlockFreq(const MachineBasicBlock *MBB, BlockFrequency F)
Definition: MBFIWrapper.cpp:29
BlockFrequency getEntryFreq() const
Definition: MBFIWrapper.cpp:50
MBFIWrapper(const MachineBlockFrequencyInfo &I)
Definition: MBFIWrapper.h:28
const MachineBlockFrequencyInfo & getMBFI() const
Definition: MBFIWrapper.h:37
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18