Skip to content

Commit d152608

Browse files
committed
Rename binary optimizer to BOLT.
Summary: BOLT - Binary Optimization and Layout Tool replaces FLO. I'm keeping .fdata extension for "feedback data". (cherry picked from FBD2908028)
1 parent 628d06b commit d152608

15 files changed

+109
-109
lines changed

bolt/BinaryBasicBlock.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include <string>
2121

2222
#undef DEBUG_TYPE
23-
#define DEBUG_TYPE "flo"
23+
#define DEBUG_TYPE "bolt"
2424

2525
namespace llvm {
26-
namespace flo {
26+
namespace bolt {
2727

2828
bool operator<(const BinaryBasicBlock &LHS, const BinaryBasicBlock &RHS) {
2929
return LHS.Offset < RHS.Offset;
@@ -63,5 +63,5 @@ void BinaryBasicBlock::removePredecessor(BinaryBasicBlock *Pred) {
6363
Predecessors.erase(I);
6464
}
6565

66-
} // namespace flo
66+
} // namespace bolt
6767
} // namespace llvm

bolt/BinaryBasicBlock.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef LLVM_TOOLS_LLVM_FLO_BINARY_BASIC_BLOCK_H
15-
#define LLVM_TOOLS_LLVM_FLO_BINARY_BASIC_BLOCK_H
14+
#ifndef LLVM_TOOLS_LLVM_BOLT_BINARY_BASIC_BLOCK_H
15+
#define LLVM_TOOLS_LLVM_BOLT_BINARY_BASIC_BLOCK_H
1616

1717
#include "llvm/ADT/StringRef.h"
1818
#include "llvm/ADT/ilist.h"
@@ -28,7 +28,7 @@
2828
#include <limits>
2929

3030
namespace llvm {
31-
namespace flo {
31+
namespace bolt {
3232

3333
class BinaryFunction;
3434

@@ -274,7 +274,7 @@ class BinaryBasicBlock {
274274
bool operator<(const BinaryBasicBlock &LHS, const BinaryBasicBlock &RHS);
275275

276276

277-
} // namespace flo
277+
} // namespace bolt
278278
} // namespace llvm
279279

280280
#endif

bolt/BinaryContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "llvm/MC/MCSymbol.h"
1616

1717
namespace llvm {
18-
namespace flo {
18+
namespace bolt {
1919

2020
MCSymbol *BinaryContext::getOrCreateGlobalSymbol(uint64_t Address,
2121
Twine Prefix) {
@@ -43,5 +43,5 @@ MCSymbol *BinaryContext::getOrCreateGlobalSymbol(uint64_t Address,
4343
return Symbol;
4444
}
4545

46-
} // namespace flo
46+
} // namespace bolt
4747
} // namespace llvm

bolt/BinaryContext.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef LLVM_TOOLS_LLVM_FLO_BINARY_CONTEXT_H
15-
#define LLVM_TOOLS_LLVM_FLO_BINARY_CONTEXT_H
14+
#ifndef LLVM_TOOLS_LLVM_BOLT_BINARY_CONTEXT_H
15+
#define LLVM_TOOLS_LLVM_BOLT_BINARY_CONTEXT_H
1616

1717
#include "llvm/ADT/Triple.h"
1818
#include "llvm/MC/MCAsmBackend.h"
@@ -35,7 +35,7 @@
3535
#include <system_error>
3636

3737
namespace llvm {
38-
namespace flo {
38+
namespace bolt {
3939

4040
class DataReader;
4141

@@ -123,7 +123,7 @@ class BinaryContext {
123123
MCSymbol *getOrCreateGlobalSymbol(uint64_t Address, Twine Prefix);
124124
};
125125

126-
} // namespace flo
126+
} // namespace bolt
127127
} // namespace llvm
128128

129129
#endif

bolt/BinaryFunction.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
#include <string>
2929

3030
#undef DEBUG_TYPE
31-
#define DEBUG_TYPE "flo"
31+
#define DEBUG_TYPE "bolt"
3232

3333
namespace llvm {
34-
namespace flo {
34+
namespace bolt {
3535

3636
namespace opts {
3737

@@ -311,7 +311,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
311311
MCSymbol *TargetSymbol{nullptr};
312312
if (!BC.MIA->evaluateRIPOperand(Instruction, Address, Size,
313313
TargetAddress)) {
314-
DEBUG(dbgs() << "FLO: rip-relative operand could not be evaluated:\n";
314+
DEBUG(dbgs() << "BOLT: rip-relative operand could not be evaluated:\n";
315315
BC.InstPrinter->printInst(&Instruction, dbgs(), "", *BC.STI);
316316
dbgs() << '\n';
317317
Instruction.dump_pretty(dbgs(), BC.InstPrinter.get());
@@ -320,7 +320,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
320320
}
321321
// FIXME: check that the address is in data, not in code.
322322
if (TargetAddress == 0) {
323-
errs() << "FLO-WARNING: rip-relative operand is zero in function "
323+
errs() << "BOLT-WARNING: rip-relative operand is zero in function "
324324
<< getName() << ". Ignoring function.\n";
325325
return false;
326326
}
@@ -342,7 +342,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
342342
nulls(),
343343
nulls())) {
344344
// Ignore this function. Skip to the next one.
345-
errs() << "FLO-WARNING: unable to disassemble instruction at offset 0x"
345+
errs() << "BOLT-WARNING: unable to disassemble instruction at offset 0x"
346346
<< Twine::utohexstr(Offset) << " (address 0x"
347347
<< Twine::utohexstr(getAddress() + Offset) << ") in function "
348348
<< getName() << '\n';
@@ -351,7 +351,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
351351
}
352352

353353
if (MIA->isUnsupported(Instruction)) {
354-
errs() << "FLO-WARNING: unsupported instruction seen at offset 0x"
354+
errs() << "BOLT-WARNING: unsupported instruction seen at offset 0x"
355355
<< Twine::utohexstr(Offset) << " (address 0x"
356356
<< Twine::utohexstr(getAddress() + Offset) << ") in function "
357357
<< getName() << '\n';
@@ -382,7 +382,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
382382
TargetSymbol = Ctx->getOrCreateSymbol(getName());
383383
} else {
384384
// Possibly an old-style PIC code
385-
errs() << "FLO: internal call detected at 0x"
385+
errs() << "BOLT: internal call detected at 0x"
386386
<< Twine::utohexstr(AbsoluteInstrAddr)
387387
<< " in function " << getName() << ". Skipping.\n";
388388
IsSimple = false;
@@ -404,7 +404,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
404404
} else {
405405
BC.InterproceduralBranchTargets.insert(InstructionTarget);
406406
if (!IsCall && Size == 2) {
407-
errs() << "FLO-WARNING: relaxed tail call detected at 0x"
407+
errs() << "BOLT-WARNING: relaxed tail call detected at 0x"
408408
<< Twine::utohexstr(AbsoluteInstrAddr)
409409
<< ". Code size will be increased.\n";
410410
}
@@ -424,7 +424,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
424424
// from the libraries. In reality more often than not it is
425425
// unreachable code, but we don't know it and have to emit calls
426426
// to 0 which make LLVM JIT unhappy.
427-
errs() << "FLO-WARNING: Function " << getName()
427+
errs() << "BOLT-WARNING: Function " << getName()
428428
<< " has a call to address zero. Ignoring function.\n";
429429
IsSimple = false;
430430
}
@@ -450,15 +450,15 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
450450
// Should be an indirect call or an indirect branch. Bail out on the
451451
// latter case.
452452
if (MIA->isIndirectBranch(Instruction)) {
453-
DEBUG(dbgs() << "FLO-WARNING: indirect branch detected at 0x"
453+
DEBUG(dbgs() << "BOLT-WARNING: indirect branch detected at 0x"
454454
<< Twine::utohexstr(AbsoluteInstrAddr)
455455
<< ". Skipping function " << getName() << ".\n");
456456
IsSimple = false;
457457
}
458458
// Indirect call. We only need to fix it if the operand is RIP-relative
459459
if (MIA->hasRIPOperand(Instruction)) {
460460
if (!handleRIPOperand(Instruction, AbsoluteInstrAddr, Size)) {
461-
errs() << "FLO-WARNING: cannot handle RIP operand at 0x"
461+
errs() << "BOLT-WARNING: cannot handle RIP operand at 0x"
462462
<< Twine::utohexstr(AbsoluteInstrAddr)
463463
<< ". Skipping function " << getName() << ".\n";
464464
IsSimple = false;
@@ -468,7 +468,7 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
468468
} else {
469469
if (MIA->hasRIPOperand(Instruction)) {
470470
if (!handleRIPOperand(Instruction, AbsoluteInstrAddr, Size)) {
471-
errs() << "FLO-WARNING: cannot handle RIP operand at 0x"
471+
errs() << "BOLT-WARNING: cannot handle RIP operand at 0x"
472472
<< Twine::utohexstr(AbsoluteInstrAddr)
473473
<< ". Skipping function " << getName() << ".\n";
474474
IsSimple = false;
@@ -765,7 +765,7 @@ void BinaryFunction::inferFallThroughCounts() {
765765
DEBUG({
766766
if (BBExecCount < ReportedBranches)
767767
dbgs()
768-
<< "FLO-WARNING: Fall-through inference is slightly inconsistent. "
768+
<< "BOLT-WARNING: Fall-through inference is slightly inconsistent. "
769769
"exec frequency is less than the outgoing edges frequency ("
770770
<< BBExecCount << " < " << ReportedBranches
771771
<< ") for BB at offset 0x"
@@ -873,7 +873,7 @@ bool BinaryFunction::fixCFIState() {
873873
// without using the state stack. Not sure if it is worth the effort
874874
// because this happens rarely.
875875
if (NestedLevel != 0) {
876-
errs() << "FLO-WARNING: CFI rewriter detected nested CFI state while "
876+
errs() << "BOLT-WARNING: CFI rewriter detected nested CFI state while "
877877
<< " replaying CFI instructions for BB " << InBB->getName()
878878
<< " in function " << getName() << '\n';
879879
return false;
@@ -947,7 +947,7 @@ bool BinaryFunction::fixCFIState() {
947947
}
948948

949949
if (StackOffset != 0) {
950-
errs() << " FLO-WARNING: not possible to remember/recover state"
950+
errs() << " BOLT-WARNING: not possible to remember/recover state"
951951
<< " without corrupting CFI state stack in function "
952952
<< getName() << "\n";
953953
return false;
@@ -1431,7 +1431,7 @@ void BinaryFunction::fixBranches() {
14311431
// invert this conditional branch logic so we can make this a fallthrough.
14321432
if (TBB == FT && !HotColdBorder) {
14331433
if (OldFT == nullptr) {
1434-
errs() << "FLO-ERROR: malfromed CFG for function " << getName()
1434+
errs() << "BOLT-ERROR: malfromed CFG for function " << getName()
14351435
<< " in basic block " << BB->getName() << '\n';
14361436
}
14371437
assert(OldFT != nullptr && "malformed CFG");
@@ -1543,5 +1543,5 @@ void BinaryFunction::splitFunction() {
15431543
}
15441544
}
15451545

1546-
} // namespace flo
1546+
} // namespace bolt
15471547
} // namespace llvm

bolt/BinaryFunction.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#ifndef LLVM_TOOLS_LLVM_FLO_BINARY_FUNCTION_H
18-
#define LLVM_TOOLS_LLVM_FLO_BINARY_FUNCTION_H
17+
#ifndef LLVM_TOOLS_LLVM_BOLT_BINARY_FUNCTION_H
18+
#define LLVM_TOOLS_LLVM_BOLT_BINARY_FUNCTION_H
1919

2020
#include "BinaryBasicBlock.h"
2121
#include "BinaryContext.h"
@@ -39,7 +39,7 @@
3939
using namespace llvm::object;
4040

4141
namespace llvm {
42-
namespace flo {
42+
namespace bolt {
4343

4444
/// BinaryFunction is a representation of machine-level function.
4545
//
@@ -747,7 +747,7 @@ inline raw_ostream &operator<<(raw_ostream &OS,
747747
return OS;
748748
}
749749

750-
} // namespace flo
750+
} // namespace bolt
751751
} // namespace llvm
752752

753753
#endif

bolt/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ set(LLVM_LINK_COMPONENTS
1111
Support
1212
)
1313

14-
add_llvm_tool(llvm-flo
15-
llvm-flo.cpp
14+
add_llvm_tool(llvm-bolt
15+
llvm-bolt.cpp
1616
BinaryBasicBlock.cpp
1717
BinaryContext.cpp
1818
BinaryFunction.cpp

bolt/DataReader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
//
88
//===----------------------------------------------------------------------===//
99
//
10-
// This family of functions reads profile data written by the perf2flo
11-
// utility and stores it in memory for llvm-flo consumption.
10+
// This family of functions reads profile data written by the perf2bolt
11+
// utility and stores it in memory for llvm-bolt consumption.
1212
//
1313
//===----------------------------------------------------------------------===//
1414

1515

1616
#include "DataReader.h"
1717

1818
namespace llvm {
19-
namespace flo {
19+
namespace bolt {
2020

2121
ErrorOr<const BranchInfo &> FuncBranchData::getBranch(uint64_t From,
2222
uint64_t To) const {
@@ -50,7 +50,7 @@ DataReader::readPerfData(StringRef Path, raw_ostream &Diag) {
5050
}
5151

5252
void DataReader::reportError(StringRef ErrorMsg) {
53-
Diag << "Error reading flo data input file: line " << Line << ", column "
53+
Diag << "Error reading bolt data input file: line " << Line << ", column "
5454
<< Col << ": " << ErrorMsg << '\n';
5555
}
5656

bolt/DataReader.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
//
88
//===----------------------------------------------------------------------===//
99
//
10-
// This family of functions reads profile data written by the perf2flo
11-
// utility and stores it in memory for llvm-flo consumption.
10+
// This family of functions reads profile data written by the perf2bolt
11+
// utility and stores it in memory for llvm-bolt consumption.
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_TOOLS_LLVM_FLO_DATA_READER_H
16-
#define LLVM_TOOLS_LLVM_FLO_DATA_READER_H
15+
#ifndef LLVM_TOOLS_LLVM_BOLT_DATA_READER_H
16+
#define LLVM_TOOLS_LLVM_BOLT_DATA_READER_H
1717

1818
#include "llvm/ADT/STLExtras.h"
1919
#include "llvm/ADT/StringMap.h"
@@ -24,7 +24,7 @@
2424
#include "llvm/Support/raw_ostream.h"
2525

2626
namespace llvm {
27-
namespace flo {
27+
namespace bolt {
2828

2929
struct Location {
3030
bool IsSymbol;
@@ -75,7 +75,7 @@ class DataReader {
7575
static ErrorOr<std::unique_ptr<DataReader>> readPerfData(StringRef Path,
7676
raw_ostream &Diag);
7777

78-
/// Parses the input flo data file into internal data structures. We expect
78+
/// Parses the input bolt data file into internal data structures. We expect
7979
/// the file format to follow the syntax below.
8080
///
8181
/// <is symbol?> <closest elf symbol or DSO name> <relative FROM address>

bolt/Exceptions.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#include "llvm/Support/raw_ostream.h"
2929

3030
#undef DEBUG_TYPE
31-
#define DEBUG_TYPE "flo-exceptions"
31+
#define DEBUG_TYPE "bolt-exceptions"
3232

3333
using namespace llvm::dwarf;
3434

3535
namespace llvm {
36-
namespace flo {
36+
namespace bolt {
3737

3838
namespace opts {
3939

@@ -171,7 +171,7 @@ void BinaryFunction::parseLSDA(ArrayRef<uint8_t> LSDASectionData,
171171
MCSymbol *LPSymbol{nullptr};
172172
if (LandingPad) {
173173
if (Instructions.find(LandingPad) == Instructions.end()) {
174-
errs() << "FLO-WARNING: landing pad " << Twine::utohexstr(LandingPad)
174+
errs() << "BOLT-WARNING: landing pad " << Twine::utohexstr(LandingPad)
175175
<< " not pointing to an instruction in function "
176176
<< getName() << " - ignoring.\n";
177177
} else {
@@ -500,7 +500,7 @@ void CFIReaderWriter::fillCFIInfoFor(BinaryFunction &Function) const {
500500

501501
const FDE &CurFDE = *I->second;
502502
if (Function.getSize() != CurFDE.getAddressRange()) {
503-
errs() << "FLO-WARNING: CFI information size mismatch for function \""
503+
errs() << "BOLT-WARNING: CFI information size mismatch for function \""
504504
<< Function.getName() << "\""
505505
<< format(": Function size is %dB, CFI covers "
506506
"%dB\n",
@@ -821,5 +821,5 @@ void CFIReaderWriter::rewriteHeaderFor(StringRef EHFrame,
821821
}
822822
}
823823

824-
} // namespace flo
824+
} // namespace bolt
825825
} // namespace llvm

0 commit comments

Comments
 (0)