Skip to content

Commit 39586b3

Browse files
author
Alexander Yermolovich
committed
addressed comments
1 parent 39c7902 commit 39586b3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ class BinaryContext {
277277

278278
public:
279279
enum class ICFLevel {
280-
None,
281-
Safe,
282-
All,
280+
None, // No ICF. (Default)
281+
Safe, // Safe ICF for all sections.
282+
All, // Aggressive ICF for code.
283283
};
284284
static Expected<std::unique_ptr<BinaryContext>>
285285
createBinaryContext(Triple TheTriple, StringRef InputFileName,

bolt/include/bolt/Passes/IdenticalCodeFolding.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ class IdenticalCodeFolding : public BinaryFunctionPass {
4040
Error runOnFunctions(BinaryContext &BC) override;
4141

4242
private:
43-
/// Analyses .text section and relocations and marks functions that are not
43+
/// Analyze .text section and relocations and mark functions that are not
4444
/// safe to fold.
4545
Error markFunctionsUnsafeToFold(BinaryContext &BC);
46-
/// Processes relocations in the .data section to identify function
46+
/// Process relocations in the .data section to identify function
4747
/// references.
4848
void processDataRelocations(BinaryContext &BC,
4949
const SectionRef &SecRefRelData);

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ static void printDebugInfo(raw_ostream &OS, const MCInst &Instruction,
20152015
OS << " discriminator:" << Row.Discriminator;
20162016
}
20172017

2018+
/// Skip instructions that are not interesting for safe ICF.
20182019
static bool skipInstruction(const MCInst &Inst, const BinaryContext &BC) {
20192020
const bool IsX86 = BC.isX86();
20202021
return (BC.MIB->isPseudo(Inst) || BC.MIB->isUnconditionalBranch(Inst) ||

0 commit comments

Comments
 (0)