#include "bolt/Passes/ContinuityStats.h"
#include "bolt/Core/BinaryBasicBlock.h"
#include "bolt/Core/BinaryFunction.h"
#include "bolt/Utils/CommandLineOpts.h"
#include "llvm/Support/CommandLine.h"
#include <queue>
#include <unordered_map>
#include <unordered_set>
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacebolt;
namespace opts {
extern cl::opt<unsigned> Verbosity;
cl::opt<unsigned> NumFunctionsForContinuityCheck(
"num-functions-for-continuity-check",
cl::desc("number of hottest functions to print aggregated "
"CFG discontinuity stats of."),
cl::init(1000), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
}
namespace {
FunctionListType;
function_iterator;
template <typename T>
void printDistribution(raw_ostream &OS, std::vector<T> &values,
bool Fraction = false) { … }
void printCFGContinuityStats(raw_ostream &OS,
iterator_range<function_iterator> &Functions) { … }
void printAll(BinaryContext &BC, FunctionListType &ValidFunctions,
size_t NumTopFunctions) { … }
}
bool PrintContinuityStats::shouldOptimize(const BinaryFunction &BF) const { … }
Error PrintContinuityStats::runOnFunctions(BinaryContext &BC) { … }