//===-- HeatUtils.cpp - Utility for printing heat colors --------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Utility for printing heat colors based on heuristics or profiling // information. // //===----------------------------------------------------------------------===// #include "llvm/Analysis/HeatUtils.h" #include "llvm/Analysis/BlockFrequencyInfo.h" #include "llvm/IR/Instructions.h" #include <cmath> namespace llvm { static const unsigned heatSize = …; static const char heatPalette[heatSize][8] = …; uint64_t getNumOfCalls(Function &callerFunction, Function &calledFunction) { … } uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI) { … } std::string getHeatColor(uint64_t freq, uint64_t maxFreq) { … } std::string getHeatColor(double percent) { … } } // namespace llvm