LLVM  14.0.0git
Functions | Variables
BasicBlockSections.cpp File Reference
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/BasicBlockSectionUtils.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Target/TargetMachine.h"
Include dependency graph for BasicBlockSections.cpp:

Go to the source code of this file.

Functions

 INITIALIZE_PASS (BasicBlockSections, "bbsections-prepare", "Prepares for basic block sections, by splitting functions " "into clusters of basic blocks.", false, false) static void updateBranches(MachineFunction &MF
 
 for (auto &MBB :MF)
 
static bool getBBClusterInfoForFunction (const MachineFunction &MF, const StringMap< StringRef > FuncAliasMap, const ProgramBBClusterInfoMapTy &ProgramBBClusterInfo, std::vector< Optional< BBClusterInfo >> &V)
 
static void assignSections (MachineFunction &MF, const std::vector< Optional< BBClusterInfo >> &FuncBBClusterInfo)
 
static bool avoidZeroOffsetLandingPad (MachineFunction &MF)
 
static bool hasInstrProfHashMismatch (MachineFunction &MF)
 
static Error getBBClusterInfo (const MemoryBuffer *MBuf, ProgramBBClusterInfoMapTy &ProgramBBClusterInfo, StringMap< StringRef > &FuncAliasMap)
 

Variables

cl::opt< bool > BBSectionsDetectSourceDrift ("bbsections-detect-source-drift", cl::desc("This checks if there is a fdo instr. profile hash " "mismatch for this function"), cl::init(true), cl::Hidden)
 
const SmallVector< MachineBasicBlock *, 4 > & PreLayoutFallThroughs
 
SmallVector< MachineOperand, 4 > Cond
 

Function Documentation

◆ assignSections()

static void assignSections ( MachineFunction MF,
const std::vector< Optional< BBClusterInfo >> &  FuncBBClusterInfo 
)
static

◆ avoidZeroOffsetLandingPad()

static bool avoidZeroOffsetLandingPad ( MachineFunction MF)
static

◆ for()

for ( auto &MBB :MF  )

◆ getBBClusterInfo()

static Error getBBClusterInfo ( const MemoryBuffer MBuf,
ProgramBBClusterInfoMapTy &  ProgramBBClusterInfo,
StringMap< StringRef > &  FuncAliasMap 
)
static

◆ getBBClusterInfoForFunction()

static bool getBBClusterInfoForFunction ( const MachineFunction MF,
const StringMap< StringRef FuncAliasMap,
const ProgramBBClusterInfoMapTy &  ProgramBBClusterInfo,
std::vector< Optional< BBClusterInfo >> &  V 
)
static

◆ hasInstrProfHashMismatch()

static bool hasInstrProfHashMismatch ( MachineFunction MF)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( BasicBlockSections  ,
"bbsections-prepare"  ,
"Prepares for basic block  sections,
by splitting functions " "into clusters of basic blocks."  ,
false  ,
false   
) &

Variable Documentation

◆ BBSectionsDetectSourceDrift

cl::opt<bool> BBSectionsDetectSourceDrift("bbsections-detect-source-drift", cl::desc("This checks if there is a fdo instr. profile hash " "mismatch for this function"), cl::init(true), cl::Hidden)

◆ Cond

Definition at line 179 of file BasicBlockSections.cpp.

Referenced by addConditions(), llvm::addPredicatedMveVpredNOp(), llvm::addPredicatedMveVpredROp(), AlmostDeadIV(), llvm::BPFInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::ARCInstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::WebAssemblyInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::AVRInstrInfo::analyzeBranch(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::R600InstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranch(), llvm::X86InstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::AnalyzeBranchImpl(), llvm::SIInstrInfo::analyzeBranchImpl(), llvm::X86InstrInfo::analyzeBranchPredicate(), llvm::analyzeICmp(), llvm::LanaiInstrInfo::analyzeSelect(), llvm::ARMBaseInstrInfo::analyzeSelect(), llvm::OpenMPIRBuilder::applyDynamicWorkshareLoop(), llvm::ScalarEvolution::applyLoopGuards(), llvm::ARMTargetLowering::ARMTargetLowering(), llvm::CanonicalLoopInfo::assertOK(), buildNonAtomicBinOp(), buildPartialInvariantUnswitchConditionalBranch(), buildPartialUnswitchConditionalBranch(), llvm::calculateUpperBound(), llvm::AArch64InstrInfo::canInsertSelect(), llvm::SIInstrInfo::canInsertSelect(), llvm::X86InstrInfo::canInsertSelect(), llvm::PPCInstrInfo::canInsertSelect(), CanProveNotTakenFirstIteration(), llvm::MachineBasicBlock::canSplitCriticalEdge(), llvm::canSplitLoopBound(), checkBoolTestAndOrSetCCCombine(), checkDecodedInstruction(), combineBrCond(), combineCMov(), combineM68kBrCond(), combineSelect(), combineSelectOfTwoConstants(), combineSubABS(), combineVSelectToBLENDV(), combineVSelectWithAllOnesOrZeros(), llvm::JumpThreadingPass::computeValueKnownInPredecessorsImpl(), ConditionalExpr::ConditionalExpr(), llvm::ConstantFoldSelectInstruction(), llvm::ConstantFoldTerminator(), ConvertSelectToConcatVector(), llvm::BranchInst::Create(), CreateAssert(), CreateAssertNot(), llvm::IRBuilderBase::CreateAssumption(), createCMovFP(), llvm::IRBuilderBase::CreateCondBr(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::OpenMPIRBuilder::createLoopSkeleton(), llvm::VPBuilder::createSelect(), createShuffleMaskFromVSELECT(), llvm::parallel::detail::Latch::dec(), DecodeLDR(), dependsOnLocalPhi(), distributeOpThroughSelect(), eliminateConstraints(), eliminateDeadSwitchCases(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), EraseTerminatorAndDCECond(), llvm::VPReductionRecipe::execute(), findLIVLoopCondition(), FindLoopCounter(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindWidenableTerminatorAboveLoop(), FixTail(), llvm::PeelingModuloScheduleExpander::fixupBranches(), llvm::CondOpInit::Fold(), foldBitCastSelect(), foldBoolSelectToLogic(), llvm::FoldBranchToCommonDest(), foldFreeOpFromSelect(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpSelectConstant(), foldMulSelectToNegate(), foldSelectGEP(), foldSelectOfConstantsUsingSra(), llvm::InstCombinerImpl::foldSelectOpOp(), foldSelectWithBinaryOp(), llvm::SelectionDAG::FoldSetCC(), foldSetClearBits(), llvm::InstCombinerImpl::FoldShiftByConstant(), foldXorTruncShiftIntoCmp(), for(), getBBFallenThrough(), getBitTestCondition(), getBranchCondString(), getCmp(), llvm::CanonicalLoopInfo::getCond(), getCondCode(), llvm::SelectionDAG::getCondCode(), llvm::MachineBasicBlock::getFallThrough(), getHashValueImpl(), getIntrinsicCmp(), llvm::HexagonInstrInfo::getInvertedPredSense(), getOnlyLiveSuccessor(), llvm::HexagonInstrInfo::getPredReg(), getPTest(), llvm::SelectionDAG::getSelect(), llvm::SelectionDAG::getSelectCC(), llvm::SelectionDAG::getSetCC(), getSETCC(), llvm::CanonicalLoopInfo::getTripCount(), llvm::MipsTargetLowering::getTypeForExtReturn(), llvm::ISD::getUnorderedFlavor(), getValueFromCondition(), getValueFromConditionImpl(), getValueOnFirstIteration(), getX86XALUOOp(), handleOtherCmpSelSimplifications(), hasOnlySelectUsers(), llvm::hasProcessableCondition(), llvm::BPFInstrInfo::insertBranch(), llvm::XCoreInstrInfo::insertBranch(), llvm::ARCInstrInfo::insertBranch(), llvm::NVPTXInstrInfo::insertBranch(), llvm::WebAssemblyInstrInfo::insertBranch(), llvm::MSP430InstrInfo::insertBranch(), llvm::MipsInstrInfo::insertBranch(), llvm::VEInstrInfo::insertBranch(), llvm::SparcInstrInfo::insertBranch(), llvm::RISCVInstrInfo::insertBranch(), llvm::AVRInstrInfo::insertBranch(), llvm::HexagonInstrInfo::insertBranch(), llvm::ARMBaseInstrInfo::insertBranch(), llvm::R600InstrInfo::insertBranch(), llvm::AArch64InstrInfo::insertBranch(), llvm::SystemZInstrInfo::insertBranch(), llvm::M68kInstrInfo::insertBranch(), llvm::SIInstrInfo::insertBranch(), llvm::X86InstrInfo::insertBranch(), llvm::PPCInstrInfo::insertBranch(), llvm::AArch64InstrInfo::insertSelect(), llvm::SIInstrInfo::insertSelect(), llvm::X86InstrInfo::insertSelect(), llvm::PPCInstrInfo::insertSelect(), llvm::SIInstrInfo::insertVectorSelect(), llvm::CanonicalLoopInfo::invalidate(), isGuaranteedNotToBeUndefOrPoison(), llvm::isImpliedByDomCondition(), isLoopNeverExecuted(), llvm::ISD::isTrueWhenEqual(), IsVPNOTEquivalent(), llvm::AMDGPULegalizerInfo::legalizeFrint(), llvm::AMDGPULegalizerInfo::legalizeUnsignedDIV_REM32Impl(), LLVMSetCondition(), llvm::X86TargetLowering::LowerAsmOutputForConstraint(), llvm::LanaiTargetLowering::LowerBR_CC(), LowerBUILD_VECTORvXi1(), llvm::AMDGPUTargetLowering::LowerFRINT(), llvm::LanaiTargetLowering::LowerSELECT_CC(), llvm::LanaiTargetLowering::LowerSETCC(), LowerSETCCCARRY(), llvm::AMDGPUTargetLowering::LowerUDIVREM(), lowerVSELECTtoVectorShuffle(), LowerVSETCC(), LowerVSETCCWithSUBUS(), LowerXALUO(), ConditionalExpr::match(), llvm::PatternMatch::LogicalOp_match< LHS, RHS, Opcode, Commutable >::match(), matchCondition(), AMDGPUPostLegalizerCombinerHelper::matchFMinFMaxLegacy(), matchSelectWithOptionalNotCond(), llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(), llvm::MSP430TargetLowering::MSP430TargetLowering(), narrowVectorSelect(), needsLFTR(), parseCC(), parseCond(), parseCondBranch(), parseConstraintCode(), AbstractManglingParser< ManglingParser< Alloc >, Alloc >::parseExpr(), llvm::parseWidenableBranch(), llvm::PeelSingleBlockLoop(), llvm::AMDGPUTargetLowering::performCtlz_CttzCombine(), llvm::HexagonTargetLowering::PerformDAGCombine(), llvm::PPCTargetLowering::PerformDAGCombine(), PerformHWLoopCombine(), performORCombine(), llvm::AMDGPUTargetLowering::performSelectCombine(), performSETCCCombine(), performSetccMergeZeroCombine(), PerformVCMPCombine(), PerformVSELECTCombine(), llvm::HexagonInstrInfo::PredicateInstruction(), llvm::HexagonInstrInfo::predOpcodeHasNot(), prepareICWorklistFromFunction(), ConditionalExpr::printLeft(), llvm::JumpThreadingPass::processImpliedCondition(), processSwitch(), llvm::JumpThreadingPass::processThreadableEdges(), recordCondition(), removeUndefIntroducingPredecessor(), replaceFoldableUses(), llvm::MSP430InstrInfo::reverseBranchCondition(), llvm::WebAssemblyInstrInfo::reverseBranchCondition(), llvm::MipsInstrInfo::reverseBranchCondition(), llvm::VEInstrInfo::reverseBranchCondition(), llvm::SparcInstrInfo::reverseBranchCondition(), llvm::XCoreInstrInfo::reverseBranchCondition(), llvm::ARCInstrInfo::reverseBranchCondition(), llvm::RISCVInstrInfo::reverseBranchCondition(), llvm::AVRInstrInfo::reverseBranchCondition(), llvm::ARMBaseInstrInfo::reverseBranchCondition(), llvm::R600InstrInfo::reverseBranchCondition(), llvm::AArch64InstrInfo::reverseBranchCondition(), llvm::HexagonInstrInfo::reverseBranchCondition(), llvm::SystemZInstrInfo::reverseBranchCondition(), llvm::SIInstrInfo::reverseBranchCondition(), llvm::X86InstrInfo::reverseBranchCondition(), llvm::PPCInstrInfo::reverseBranchCondition(), llvm::RewriteStatepointsForGC::runOnFunction(), simplifyCmpSelCase(), simplifyCmpSelFalseCase(), simplifyCmpSelTrueCase(), SimplifyCondBranchToCondBranch(), simplifyOneLoop(), llvm::SelectionDAG::simplifySelect(), llvm::SimplifySelectInst(), SimplifySelectInst(), llvm::InstCombinerImpl::SimplifySelectsFeedingBinaryOp(), simplifySelectWithFCmp(), llvm::TargetLowering::SimplifySetCC(), simplifySetCCWithCTPOP(), simplifyTerminatorLeadingToRet(), SimplifyUsingControlFlow(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), llvm::MachineBasicBlock::SplitCriticalEdge(), splitEdge(), splitIntVSETCC(), llvm::splitLoopBound(), switchToSelect(), llvm::parallel::detail::Latch::sync(), ThreadCmpOverSelect(), transformToIndexedCompare(), llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(), unswitchBestCondition(), unswitchNontrivialInvariants(), llvm::MachineBasicBlock::updateTerminator(), llvm::HexagonInstrInfo::validateBranchCond(), versionCallSite(), llvm::Interpreter::visitBranchInst(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFPTrunc(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSub(), llvm::SelectionDAGBuilder::visitSwitchCase(), llvm::Interpreter::visitSwitchInst(), llvm::InstCombinerImpl::visitSwitchInst(), llvm::InnerLoopVectorizer::widenSelectInstruction(), and llvm::wouldInstructionBeTriviallyDead().

◆ PreLayoutFallThroughs

const SmallVector<MachineBasicBlock *, 4>& PreLayoutFallThroughs
Initial value:
{
const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo()

Definition at line 177 of file BasicBlockSections.cpp.

Referenced by for(), and llvm::sortBasicBlocksAndUpdateBranches().

llvm::TargetInstrInfo
TargetInstrInfo - Interface to description of machine instruction set.
Definition: TargetInstrInfo.h:97
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:129