LLVM
15.0.0git
include
llvm
Analysis
HeatUtils.h
Go to the documentation of this file.
1
//===-- HeatUtils.h - Utility for printing heat colors ----------*- 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
// Utility for printing heat colors based on profiling information.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_ANALYSIS_HEATUTILS_H
14
#define LLVM_ANALYSIS_HEATUTILS_H
15
16
#include <cstdint>
17
#include <string>
18
19
namespace
llvm
{
20
21
class
BlockFrequencyInfo;
22
class
Function
;
23
24
// Returns number of calls of calledFunction by callerFunction.
25
uint64_t
26
getNumOfCalls
(Function &callerFunction, Function &calledFunction);
27
28
// Returns the maximum frequency of a BB in a function.
29
uint64_t
getMaxFreq
(
const
Function &
F
,
const
BlockFrequencyInfo *
BFI
);
30
31
// Calculates heat color based on current and maximum frequencies.
32
std::string
getHeatColor
(
uint64_t
freq
,
uint64_t
maxFreq);
33
34
// Calculates heat color based on percent of "hotness".
35
std::string
getHeatColor
(
double
percent);
36
37
}
// namespace llvm
38
39
#endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:17
llvm::getMaxFreq
uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI)
Definition:
HeatUtils.cpp:51
freq
block freq
Definition:
BlockFrequencyInfo.cpp:300
llvm::getHeatColor
std::string getHeatColor(uint64_t freq, uint64_t maxFreq)
Definition:
HeatUtils.cpp:61
F
#define F(x, y, z)
Definition:
MD5.cpp:55
uint64_t
llvm::AMDGPUISD::BFI
@ BFI
Definition:
AMDGPUISelLowering.h:429
llvm::getNumOfCalls
uint64_t getNumOfCalls(Function &callerFunction, Function &calledFunction)
Definition:
HeatUtils.cpp:39
llvm::codeview::PublicSymFlags::Function
@ Function
Generated on Sat Jun 25 2022 12:48:54 for LLVM by
1.8.17