forked from OSchip/llvm-project
[Bolt][NFC] Change capitalization s/BOLT/Bolt/g
(cherry picked from FBD8373789)
This commit is contained in:
parent
232046f9b2
commit
789162276d
|
@ -1,21 +1,21 @@
|
|||
BOLT
|
||||
Bolt
|
||||
====
|
||||
|
||||
BOLT is a post-link optimizer developed to speed up large applications.
|
||||
Bolt is a post-link optimizer developed to speed up large applications.
|
||||
It achieves speed-ups by optimizing application's code layout based on an
|
||||
execution profile gathered by sampling profilers such as Linux `perf` tool.
|
||||
BOLT could operate on any binary with symbol table, but for maximum gains
|
||||
Bolt could operate on any binary with symbol table, but for maximum gains
|
||||
it utilizes relocations saved by a linker (--emit-relocs).
|
||||
|
||||
NOTE: Currently BOLT support is limited to non-PIC/PIE binaries.
|
||||
NOTE: Currently Bolt support is limited to non-PIC/non-PIE binaries.
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
BOLT heavily uses LLVM libraries and by design it is built as one of LLVM
|
||||
Bolt heavily uses LLVM libraries and by design it is built as one of LLVM
|
||||
tools. The build process in not much different from regular LLVM.
|
||||
|
||||
Start with cloning LLVM and BOLT repos:
|
||||
Start with cloning LLVM and Bolt repos:
|
||||
|
||||
> git clone https://github.com/llvm-mirror/llvm llvm
|
||||
> cd llvm/tools
|
||||
|
|
|
@ -258,7 +258,7 @@ public:
|
|||
uint64_t MissedMacroFusionExecCount{0};
|
||||
|
||||
/// Track next available address for new allocatable sections. RewriteInstance
|
||||
/// sets this prior to running BOLT passes, so layout passes are aware of the
|
||||
/// sets this prior to running Bolt passes, so layout passes are aware of the
|
||||
/// final addresses functions will have.
|
||||
uint64_t LayoutStartAddress{0};
|
||||
|
||||
|
|
|
@ -300,7 +300,7 @@ BinaryFunction::getBasicBlockContainingOffset(uint64_t Offset) {
|
|||
return nullptr;
|
||||
|
||||
/*
|
||||
* This is commented out because it makes BOLT too slow.
|
||||
* This is commented out because it makes Bolt too slow.
|
||||
* assert(std::is_sorted(BasicBlockOffsets.begin(),
|
||||
* BasicBlockOffsets.end(),
|
||||
* CompareBasicBlockOffsets())));
|
||||
|
|
|
@ -50,7 +50,7 @@ IgnoreBuildID("ignore-build-id",
|
|||
|
||||
static cl::opt<bool>
|
||||
TimeAggregator("time-aggr",
|
||||
cl::desc("time BOLT aggregator"),
|
||||
cl::desc("time Bolt aggregator"),
|
||||
cl::init(false),
|
||||
cl::ZeroOrMore,
|
||||
cl::cat(AggregatorCategory));
|
||||
|
|
|
@ -89,7 +89,7 @@ class DataAggregator : public DataReader {
|
|||
|
||||
DenseSet<int64_t> PIDs;
|
||||
|
||||
/// References to core BOLT data structures
|
||||
/// References to core Bolt data structures
|
||||
BinaryContext *BC{nullptr};
|
||||
std::map<uint64_t, BinaryFunction> *BFs{nullptr};
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ Optional<StringRef> getLTOCommonName(const StringRef Name) {
|
|||
|
||||
namespace {
|
||||
|
||||
/// Return standard name of the function possibly renamed by BOLT.
|
||||
/// Return standard name of the function possibly renamed by Bolt.
|
||||
StringRef normalizeName(StringRef Name) {
|
||||
// Strip "PG." prefix used for globalized locals.
|
||||
return Name.startswith("PG.") ? Name.substr(2) : Name;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===--- Passes/Inliner.cpp - Inlining infra for BOLT ---------------------===//
|
||||
//===--- Passes/Inliner.cpp - Inlining infra for Bolt ---------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===--- Passes/Inliner.h - Inlining infra for BOLT -----------------------===//
|
||||
//===--- Passes/Inliner.h - Inlining infra for Bolt -----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace bolt {
|
|||
|
||||
/// This pass identify indirect jumps to jump tables and reduce their entries
|
||||
/// size from 8 to 4 bytes. For PIC jump tables, it will remove the PIC code
|
||||
/// (since BOLT only process static code and it makes no sense to use expensive
|
||||
/// (since Bolt only process static code and it makes no sense to use expensive
|
||||
/// PIC-style jumps in static code).
|
||||
class JTFootprintReduction : public BinaryFunctionPass {
|
||||
uint64_t TotalJTScore{0};
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace bolt {
|
|||
|
||||
/// LongJmp is veneer-insertion pass originally written for AArch64 that
|
||||
/// compensates for its short-range branches, typically done during linking. We
|
||||
/// pull this pass inside BOLT because here we can do a better job at stub
|
||||
/// pull this pass inside Bolt because here we can do a better job at stub
|
||||
/// inserting by manipulating the CFG, something linkers can't do.
|
||||
///
|
||||
/// LongJmp is a two-step process. In the first step, when function sizes are
|
||||
|
|
|
@ -419,7 +419,7 @@ void RegReAssign::runOnFunctions(BinaryContext &BC,
|
|||
outs() << "BOLT-WARNING: You used -reg-reassign and -update-debug-sections."
|
||||
<< " Some registers were changed but associated AT_LOCATION for "
|
||||
<< "impacted variables were NOT updated! This operation is "
|
||||
<< "currently unsupported by BOLT.\n";
|
||||
<< "currently unsupported by Bolt.\n";
|
||||
}
|
||||
outs() << "BOLT-INFO: Reg Reassignment Pass Stats:\n";
|
||||
outs() << "\t " << FuncsChanged.size() << " functions affected.\n";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===-- ProfileReader.cpp - BOLT profile de-serializer ----------*- C++ -*-===//
|
||||
//===-- ProfileReader.cpp - Bolt profile de-serializer ----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===-- ProfileReader.h - BOLT profile deserializer -------------*- C++ -*-===//
|
||||
//===-- ProfileReader.h - Bolt profile deserializer -------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===-- ProfileYAMLMapping.h - mappings for BOLT profile --------*- C++ -*-===//
|
||||
//===-- ProfileYAMLMapping.h - mappings for Bolt profile --------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -353,7 +353,7 @@ Verbosity("v",
|
|||
|
||||
static cl::opt<bool>
|
||||
AddBoltInfo("add-bolt-info",
|
||||
cl::desc("add BOLT version and command line argument information to "
|
||||
cl::desc("add Bolt version and command line argument information to "
|
||||
"processed binaries"),
|
||||
cl::init(true),
|
||||
cl::cat(BoltCategory));
|
||||
|
@ -482,7 +482,7 @@ constexpr const char *RewriteInstance::SectionsToOverwrite[];
|
|||
|
||||
const std::string RewriteInstance::OrgSecPrefix = ".bolt.org";
|
||||
|
||||
const std::string RewriteInstance::BOLTSecPrefix = ".bolt";
|
||||
const std::string RewriteInstance::BoltSecPrefix = ".bolt";
|
||||
|
||||
const char RewriteInstance::TimerGroupName[] = "rewrite";
|
||||
const char RewriteInstance::TimerGroupDesc[] = "Rewrite passes";
|
||||
|
@ -835,7 +835,7 @@ void RewriteInstance::discoverStorage() {
|
|||
}
|
||||
|
||||
if (SectionName.startswith(OrgSecPrefix) ||
|
||||
SectionName.startswith(BOLTSecPrefix)) {
|
||||
SectionName.startswith(BoltSecPrefix)) {
|
||||
errs() << "BOLT-ERROR: input file was processed by BOLT. "
|
||||
"Cannot re-optimize.\n";
|
||||
exit(1);
|
||||
|
@ -1001,7 +1001,8 @@ void RewriteInstance::run() {
|
|||
checkLargeFunctions()) {
|
||||
++PassNumber;
|
||||
// Emit again because now some functions have been split
|
||||
outs() << "BOLT: split-functions: starting pass " << PassNumber << "...\n";
|
||||
outs() << "BOLT-INFO: split-functions: starting pass " << PassNumber
|
||||
<< "...\n";
|
||||
reset();
|
||||
executeRewritePass({});
|
||||
}
|
||||
|
@ -1012,7 +1013,7 @@ void RewriteInstance::run() {
|
|||
if (opts::UpdateDebugSections && opts::FixDebugInfoLargeFunctions &&
|
||||
checkLargeFunctions()) {
|
||||
++PassNumber;
|
||||
outs() << "BOLT: starting pass (ignoring large functions) "
|
||||
outs() << "BOLT-INFO: starting pass (ignoring large functions) "
|
||||
<< PassNumber << "...\n";
|
||||
reset();
|
||||
executeRewritePass(LargeFunctions);
|
||||
|
@ -1182,7 +1183,7 @@ void RewriteInstance::discoverFileObjects() {
|
|||
std::string AlternativeName;
|
||||
if (Name.empty()) {
|
||||
if (PLTSection && PLTSection->getAddress() == Address) {
|
||||
// Don't register BOLT_PLT_PSEUDO twice.
|
||||
// Don't register __BOLT_PLT_PSEUDO twice.
|
||||
continue;
|
||||
}
|
||||
UniqueName = "ANONYMOUS." + std::to_string(AnonymousId++);
|
||||
|
@ -2269,7 +2270,7 @@ void RewriteInstance::readRelocations(const SectionRef &Section) {
|
|||
(BD->nameStartsWith("ANONYMOUS") &&
|
||||
(BD->getSectionName().startswith(".plt") ||
|
||||
BD->getSectionName().endswith(".plt")))) &&
|
||||
"BOLT symbol names of all non-section relocations must match "
|
||||
"Bolt symbol names of all non-section relocations must match "
|
||||
"up with symbol names referenced in the relocation");
|
||||
|
||||
if (!opts::AllowSectionRelocations && IsSectionRelocation) {
|
||||
|
@ -3072,7 +3073,7 @@ void RewriteInstance::mapTextSections(orc::VModuleKey Key) {
|
|||
const auto Flags = BinarySection::getFlags(/*IsReadOnly=*/true,
|
||||
/*IsText=*/true,
|
||||
/*IsAllocatable=*/true);
|
||||
auto &Section = BC->registerOrUpdateSection(BOLTSecPrefix + ".text",
|
||||
auto &Section = BC->registerOrUpdateSection(BoltSecPrefix + ".text",
|
||||
ELF::SHT_PROGBITS,
|
||||
Flags,
|
||||
nullptr,
|
||||
|
@ -3577,7 +3578,7 @@ void RewriteInstance::addBoltInfoSection() {
|
|||
std::string DescStr;
|
||||
raw_string_ostream DescOS(DescStr);
|
||||
|
||||
DescOS << "BOLT revision: " << BoltRevision << ", " << "command line:";
|
||||
DescOS << "Bolt revision: " << BoltRevision << ", " << "command line:";
|
||||
for (auto I = 0; I < Argc; ++I) {
|
||||
DescOS << " " << Argv[I];
|
||||
}
|
||||
|
@ -4377,7 +4378,7 @@ void RewriteInstance::rewriteFile() {
|
|||
OverwrittenScore += Function.getFunctionScore();
|
||||
// Overwrite function in the output file.
|
||||
if (opts::Verbosity >= 2) {
|
||||
outs() << "BOLT: rewriting function \"" << Function << "\"\n";
|
||||
outs() << "BOLT-INFO: rewriting function \"" << Function << "\"\n";
|
||||
}
|
||||
OS.pwrite(reinterpret_cast<char *>(Function.getImageAddress()),
|
||||
Function.getImageSize(),
|
||||
|
@ -4407,7 +4408,7 @@ void RewriteInstance::rewriteFile() {
|
|||
++CountOverwrittenFunctions;
|
||||
if (opts::MaxFunctions &&
|
||||
CountOverwrittenFunctions == opts::MaxFunctions) {
|
||||
outs() << "BOLT: maximum number of functions reached\n";
|
||||
outs() << "BOLT-INFO: maximum number of functions reached\n";
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -4415,7 +4416,7 @@ void RewriteInstance::rewriteFile() {
|
|||
|
||||
// Write cold part
|
||||
if (opts::Verbosity >= 2) {
|
||||
outs() << "BOLT: rewriting function \"" << Function
|
||||
outs() << "BOLT-INFO: rewriting function \"" << Function
|
||||
<< "\" (cold part)\n";
|
||||
}
|
||||
OS.pwrite(reinterpret_cast<char*>(Function.cold().getImageAddress()),
|
||||
|
@ -4427,7 +4428,7 @@ void RewriteInstance::rewriteFile() {
|
|||
++CountOverwrittenFunctions;
|
||||
if (opts::MaxFunctions &&
|
||||
CountOverwrittenFunctions == opts::MaxFunctions) {
|
||||
outs() << "BOLT: maximum number of functions reached\n";
|
||||
outs() << "BOLT-INFO: maximum number of functions reached\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4464,7 +4465,7 @@ void RewriteInstance::rewriteFile() {
|
|||
if (!Section.isFinalized() || Section.isLocal())
|
||||
continue;
|
||||
if (opts::Verbosity >= 1) {
|
||||
outs() << "BOLT: writing new section " << Section.getName()
|
||||
outs() << "BOLT-INFO: writing new section " << Section.getName()
|
||||
<< "\n data at 0x" << Twine::utohexstr(Section.getAllocAddress())
|
||||
<< "\n of size " << Section.getOutputSize()
|
||||
<< "\n at offset " << Section.getFileOffset() << '\n';
|
||||
|
|
|
@ -323,7 +323,7 @@ private:
|
|||
std::vector<ELFShdrTy> *OutputSections = nullptr,
|
||||
std::map<std::string, uint32_t> *OutputSectionNameMap = nullptr);
|
||||
|
||||
/// Add a notes section containing the BOLT revision and command line options.
|
||||
/// Add a notes section containing the Bolt revision and command line options.
|
||||
void addBoltInfoSection();
|
||||
|
||||
/// Computes output .debug_line line table offsets for each compile unit,
|
||||
|
@ -522,7 +522,7 @@ private:
|
|||
|
||||
static const std::string OrgSecPrefix;
|
||||
|
||||
static const std::string BOLTSecPrefix;
|
||||
static const std::string BoltSecPrefix;
|
||||
|
||||
/// Number of processed to data relocations. Used to implement the
|
||||
/// -max-relocations debugging option.
|
||||
|
|
|
@ -214,7 +214,7 @@ public:
|
|||
bool hasPCRelOperand(const MCInst &Inst) const override {
|
||||
// ADRP is blacklisted and is an exception. Even though it has a
|
||||
// PC-relative operand, this operand is not a complete symbol reference
|
||||
// and BOLT shouldn't try to process it in isolation.
|
||||
// and Bolt shouldn't try to process it in isolation.
|
||||
if (isADRP(Inst))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ using namespace bolt;
|
|||
|
||||
namespace opts {
|
||||
|
||||
cl::OptionCategory BoltCategory("BOLT generic options");
|
||||
cl::OptionCategory BoltDiffCategory("BOLTDIFF generic options");
|
||||
cl::OptionCategory BoltOptCategory("BOLT optimization options");
|
||||
cl::OptionCategory BoltRelocCategory("BOLT options in relocation mode");
|
||||
cl::OptionCategory BoltCategory("Bolt generic options");
|
||||
cl::OptionCategory BoltDiffCategory("BoltDiff generic options");
|
||||
cl::OptionCategory BoltOptCategory("Bolt optimization options");
|
||||
cl::OptionCategory BoltRelocCategory("Bolt options in relocation mode");
|
||||
cl::OptionCategory BoltOutputCategory("Output options");
|
||||
cl::OptionCategory AggregatorCategory("Data aggregation options");
|
||||
|
||||
|
@ -124,14 +124,14 @@ const char *BoltRevision =
|
|||
}
|
||||
|
||||
static void printBoltRevision(llvm::raw_ostream &OS) {
|
||||
OS << "BOLT revision " << BoltRevision << "\n";
|
||||
OS << "Bolt revision " << BoltRevision << "\n";
|
||||
}
|
||||
|
||||
void perf2boltMode(int argc, char **argv) {
|
||||
cl::HideUnrelatedOptions(makeArrayRef(opts::Perf2BoltCategories));
|
||||
cl::ParseCommandLineOptions(
|
||||
argc, argv,
|
||||
"perf2bolt - BOLT data aggregator\n"
|
||||
"perf2bolt - Bolt data aggregator\n"
|
||||
"\nEXAMPLE: perf2bolt -p=perf.data executable -o data.fdata\n");
|
||||
if (opts::PerfData.empty()) {
|
||||
errs() << ToolName << ": expected -perfdata=<filename> option.\n";
|
||||
|
@ -159,7 +159,7 @@ void boltDiffMode(int argc, char **argv) {
|
|||
cl::HideUnrelatedOptions(makeArrayRef(opts::BoltDiffCategories));
|
||||
cl::ParseCommandLineOptions(
|
||||
argc, argv,
|
||||
"llvm-boltdiff - BOLT binary diff tool\n"
|
||||
"llvm-boltdiff - Bolt binary diff tool\n"
|
||||
"\nEXAMPLE: llvm-boltdiff -data=a.fdata -data2=b.fdata exec1 exec2\n");
|
||||
if (opts::InputDataFilename2.empty()) {
|
||||
errs() << ToolName << ": expected -data2=<filename> option.\n";
|
||||
|
@ -187,7 +187,7 @@ void boltMode(int argc, char **argv) {
|
|||
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
|
||||
|
||||
cl::ParseCommandLineOptions(argc, argv,
|
||||
"BOLT - Binary Optimization and Layout Tool\n");
|
||||
"Bolt - Binary Optimization and Layout Tool\n");
|
||||
|
||||
if (opts::OutputFilename.empty()) {
|
||||
errs() << ToolName << ": expected -o=<output file> option.\n";
|
||||
|
|
Loading…
Reference in New Issue