LLVM  14.0.0git
HeatUtils.h
Go to the documentation of this file.
1 //===-- HeatUtils.h - Utility for printing heat colors ----------*- C++ -*-===//
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 // Utility for printing heat colors based on profiling information.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_HEATUTILS_H
15 #define LLVM_ANALYSIS_HEATUTILS_H
16 
17 #include <cstdint>
18 #include <string>
19 
20 namespace llvm {
21 
22 class BlockFrequencyInfo;
23 class Function;
24 
25 // Returns number of calls of calledFunction by callerFunction.
26 uint64_t
27 getNumOfCalls(Function &callerFunction, Function &calledFunction);
28 
29 // Returns the maximum frequency of a BB in a function.
30 uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI);
31 
32 // Calculates heat color based on current and maximum frequencies.
33 std::string getHeatColor(uint64_t freq, uint64_t maxFreq);
34 
35 // Calculates heat color based on percent of "hotness".
36 std::string getHeatColor(double percent);
37 
38 } // namespace llvm
39 
40 #endif
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::getMaxFreq
uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI)
Definition: HeatUtils.cpp:52
freq
block freq
Definition: BlockFrequencyInfo.cpp:301
llvm::getHeatColor
std::string getHeatColor(uint64_t freq, uint64_t maxFreq)
Definition: HeatUtils.cpp:62
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::AMDGPUISD::BFI
@ BFI
Definition: AMDGPUISelLowering.h:421
llvm::getNumOfCalls
uint64_t getNumOfCalls(Function &callerFunction, Function &calledFunction)
Definition: HeatUtils.cpp:40
llvm::codeview::PublicSymFlags::Function
@ Function