#include "bolt/Core/DynoStats.h"
#include "bolt/Core/BinaryBasicBlock.h"
#include "bolt/Core/BinaryFunction.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>
#undef DEBUG_TYPE
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacebolt;
namespace opts {
extern cl::OptionCategory BoltCategory;
static cl::opt<uint32_t>
DynoStatsScale("dyno-stats-scale",
cl::desc("scale to be applied while reporting dyno stats"),
cl::Optional,
cl::init(1),
cl::Hidden,
cl::cat(BoltCategory));
static cl::opt<uint32_t>
PrintDynoOpcodeStat("print-dyno-opcode-stats",
cl::desc("print per instruction opcode dyno stats and the function"
"names:BB offsets of the nth highest execution counts"),
cl::init(0),
cl::Hidden,
cl::cat(BoltCategory));
}
namespace llvm {
namespace bolt {
constexpr const char *DynoStats::Desc[];
bool DynoStats::operator<(const DynoStats &Other) const { … }
bool DynoStats::operator==(const DynoStats &Other) const { … }
bool DynoStats::lessThan(const DynoStats &Other,
ArrayRef<Category> Keys) const { … }
void DynoStats::print(raw_ostream &OS, const DynoStats *Other,
MCInstPrinter *Printer) const { … }
void DynoStats::operator+=(const DynoStats &Other) { … }
DynoStats getDynoStats(BinaryFunction &BF) { … }
}
}