diff options
Diffstat (limited to 'contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h')
-rw-r--r-- | contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h index bfa5bf6..cba79c8 100644 --- a/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h +++ b/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h @@ -1,4 +1,4 @@ -//===- MachineBlockFrequencyInfo.h - MBB Frequency Analysis -*- C++ -*-----===// +//===- MachineBlockFrequencyInfo.h - MBB Frequency Analysis -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,31 +17,39 @@ #include "llvm/ADT/Optional.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/BlockFrequency.h" -#include <climits> +#include <cstdint> +#include <memory> namespace llvm { +template <class BlockT> class BlockFrequencyInfoImpl; class MachineBasicBlock; class MachineBranchProbabilityInfo; -template <class BlockT> class BlockFrequencyInfoImpl; +class MachineFunction; +class MachineLoopInfo; +class raw_ostream; /// MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation /// to estimate machine basic block frequencies. class MachineBlockFrequencyInfo : public MachineFunctionPass { - typedef BlockFrequencyInfoImpl<MachineBasicBlock> ImplType; + using ImplType = BlockFrequencyInfoImpl<MachineBasicBlock>; std::unique_ptr<ImplType> MBFI; public: static char ID; MachineBlockFrequencyInfo(); - ~MachineBlockFrequencyInfo() override; void getAnalysisUsage(AnalysisUsage &AU) const override; bool runOnMachineFunction(MachineFunction &F) override; + /// calculate - compute block frequency info for the given function. + void calculate(const MachineFunction &F, + const MachineBranchProbabilityInfo &MBPI, + const MachineLoopInfo &MLI); + void releaseMemory() override; /// getblockFreq - Return block frequency. Return 0 if we don't have the @@ -56,7 +64,7 @@ public: const MachineFunction *getFunction() const; const MachineBranchProbabilityInfo *getMBPI() const; - void view() const; + void view(const Twine &Name, bool isSimple = true) const; // Print the block frequency Freq to OS using the current functions entry // frequency to convert freq into a relative decimal form. @@ -68,9 +76,8 @@ public: const MachineBasicBlock *MBB) const; uint64_t getEntryFreq() const; - }; -} +} // end namespace llvm -#endif +#endif // LLVM_CODEGEN_MACHINEBLOCKFREQUENCYINFO_H |