[NFC] Rename BBSectionsPrepare -> BasicBlockSections.

Rename the BBSectionsPrepare pass as suggested by the review comment in
https://reviews.llvm.org/D85368.

Differential Revision: https://reviews.llvm.org/D85380
This commit is contained in:
Snehasish Kumar 2020-08-05 17:11:48 -07:00
parent f406a90a08
commit 8d943a928d
7 changed files with 24 additions and 24 deletions

View File

@ -44,11 +44,11 @@ namespace llvm {
/// the entry block.
FunctionPass *createUnreachableBlockEliminationPass();
/// createBBSectionsPrepare Pass - This pass assigns sections to machine basic
/// blocks and is enabled with -fbasic-block-sections.
/// Buf is a memory buffer that contains the list of functions and basic
/// block ids to selectively enable basic block sections.
MachineFunctionPass *createBBSectionsPreparePass(const MemoryBuffer *Buf);
/// createBasicBlockSections Pass - This pass assigns sections to machine
/// basic blocks and is enabled with -fbasic-block-sections. Buf is a memory
/// buffer that contains the list of functions and basic block ids to
/// selectively enable basic block sections.
MachineFunctionPass *createBasicBlockSectionsPass(const MemoryBuffer *Buf);
/// MachineFunctionPrinter pass - This pass prints out the machine function to
/// the given stream as a debugging tool.

View File

@ -79,7 +79,7 @@ void initializeAssumptionCacheTrackerPass(PassRegistry&);
void initializeAtomicExpandPass(PassRegistry&);
void initializeAttributorLegacyPassPass(PassRegistry&);
void initializeAttributorCGSCCLegacyPassPass(PassRegistry &);
void initializeBBSectionsPreparePass(PassRegistry &);
void initializeBasicBlockSectionsPass(PassRegistry &);
void initializeBDCELegacyPassPass(PassRegistry&);
void initializeBarrierNoopPass(PassRegistry&);
void initializeBasicAAWrapperPassPass(PassRegistry&);

View File

@ -1,4 +1,4 @@
//===-- BBSectionsPrepare.cpp ---=========---------------------------------===//
//===-- BasicBlockSections.cpp ---=========--------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
// BBSectionsPrepare implementation.
// BasicBlockSections implementation.
//
// The purpose of this pass is to assign sections to basic blocks when
// -fbasic-block-sections= option is used. Further, with profile information
@ -100,7 +100,7 @@ struct BBClusterInfo {
using ProgramBBClusterInfoMapTy = StringMap<SmallVector<BBClusterInfo, 4>>;
class BBSectionsPrepare : public MachineFunctionPass {
class BasicBlockSections : public MachineFunctionPass {
public:
static char ID;
@ -119,13 +119,13 @@ public:
// name for which we have mapping in ProgramBBClusterInfo.
StringMap<StringRef> FuncAliasMap;
BBSectionsPrepare(const MemoryBuffer *Buf)
BasicBlockSections(const MemoryBuffer *Buf)
: MachineFunctionPass(ID), MBuf(Buf) {
initializeBBSectionsPreparePass(*PassRegistry::getPassRegistry());
initializeBasicBlockSectionsPass(*PassRegistry::getPassRegistry());
};
BBSectionsPrepare() : MachineFunctionPass(ID) {
initializeBBSectionsPreparePass(*PassRegistry::getPassRegistry());
BasicBlockSections() : MachineFunctionPass(ID) {
initializeBasicBlockSectionsPass(*PassRegistry::getPassRegistry());
}
StringRef getPassName() const override {
@ -144,8 +144,8 @@ public:
} // end anonymous namespace
char BBSectionsPrepare::ID = 0;
INITIALIZE_PASS(BBSectionsPrepare, "bbsections-prepare",
char BasicBlockSections::ID = 0;
INITIALIZE_PASS(BasicBlockSections, "bbsections-prepare",
"Prepares for basic block sections, by splitting functions "
"into clusters of basic blocks.",
false, false)
@ -324,7 +324,7 @@ static bool assignSectionsAndSortBasicBlocks(
return true;
}
bool BBSectionsPrepare::runOnMachineFunction(MachineFunction &MF) {
bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) {
auto BBSectionsType = MF.getTarget().getBBSectionsType();
assert(BBSectionsType != BasicBlockSection::None &&
"BB Sections not enabled!");
@ -438,7 +438,7 @@ static Error getBBClusterInfo(const MemoryBuffer *MBuf,
return Error::success();
}
bool BBSectionsPrepare::doInitialization(Module &M) {
bool BasicBlockSections::doInitialization(Module &M) {
if (!MBuf)
return false;
if (auto Err = getBBClusterInfo(MBuf, ProgramBBClusterInfo, FuncAliasMap))
@ -446,12 +446,12 @@ bool BBSectionsPrepare::doInitialization(Module &M) {
return false;
}
void BBSectionsPrepare::getAnalysisUsage(AnalysisUsage &AU) const {
void BasicBlockSections::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
MachineFunctionPass *
llvm::createBBSectionsPreparePass(const MemoryBuffer *Buf) {
return new BBSectionsPrepare(Buf);
llvm::createBasicBlockSectionsPass(const MemoryBuffer *Buf) {
return new BasicBlockSections(Buf);
}

View File

@ -8,7 +8,7 @@ add_llvm_component_library(LLVMCodeGen
BranchRelaxation.cpp
BreakFalseDeps.cpp
BuiltinGCs.cpp
BBSectionsPrepare.cpp
BasicBlockSections.cpp
CalcSpillWeights.cpp
CallingConvLower.cpp
CFGuardLongjmp.cpp

View File

@ -20,7 +20,7 @@ using namespace llvm;
/// initializeCodeGen - Initialize all passes linked into the CodeGen library.
void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeAtomicExpandPass(Registry);
initializeBBSectionsPreparePass(Registry);
initializeBasicBlockSectionsPass(Registry);
initializeBranchFolderPassPass(Registry);
initializeBranchRelaxationPass(Registry);
initializeCFGuardLongjmpPass(Registry);

View File

@ -1015,7 +1015,7 @@ void TargetPassConfig::addMachinePasses() {
}
if (TM->getBBSectionsType() != llvm::BasicBlockSection::None)
addPass(llvm::createBBSectionsPreparePass(TM->getBBSectionsFuncListBuf()));
addPass(llvm::createBasicBlockSectionsPass(TM->getBBSectionsFuncListBuf()));
// Add passes that directly emit MI after all other MI passes.
addPreEmitPass2();

View File

@ -21,7 +21,7 @@ static_library("CodeGen") {
"AllocationOrder.cpp",
"Analysis.cpp",
"AtomicExpandPass.cpp",
"BBSectionsPrepare.cpp",
"BasicBlockSections.cpp",
"BasicTargetTransformInfo.cpp",
"BranchFolding.cpp",
"BranchRelaxation.cpp",