LLVM
12.0.0git
|
#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"
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 Error | getBBClusterInfo (const MemoryBuffer *MBuf, ProgramBBClusterInfoMapTy &ProgramBBClusterInfo, StringMap< StringRef > &FuncAliasMap) |
Variables | |
const SmallVector< MachineBasicBlock *, 4 > & | PreLayoutFallThroughs |
SmallVector< MachineOperand, 4 > | Cond |
|
static |
Definition at line 232 of file BasicBlockSections.cpp.
References llvm::All, assert(), llvm::MBBSectionID::ColdSectionID, llvm::MBBSectionID::ExceptionSectionID, llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getSectionID(), llvm::MachineFunction::hasBBSections(), llvm::MachineBasicBlock::isEHPad(), MBB, and llvm::MachineBasicBlock::setSectionID().
|
static |
Definition at line 300 of file BasicBlockSections.cpp.
References llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MDNode::get(), llvm::MCInst::getOpcode(), llvm::MachineBasicBlock::isBeginSection(), llvm::MachineBasicBlock::isEHPad(), MBB, and MI.
for | ( | auto &MBB :MF | ) |
Definition at line 162 of file BasicBlockSections.cpp.
References llvm::HexagonInstrInfo::analyzeBranch(), Cond, llvm::MachineBasicBlock::findBranchDebugLoc(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::isEndSection(), MBB, PreLayoutFallThroughs, TII, and llvm::MachineBasicBlock::updateTerminator().
Referenced by analyzeGlobalAux(), checkDyldCommand(), checkDylibCommand(), checkRpathCommand(), checkSubCommand(), collectBitParts(), llvm::AppleAcceleratorTable::dump(), llvm::BitTracker::RegisterCell::extract(), firstch(), freeset(), freezeset(), llvm::TargetLowering::getMultipleConstraintMatchWeight(), llvm::SelectionDAGBuilder::handleDebugValue(), INITIALIZE_PASS(), isProfitableChain(), nch(), llvm::BitVector::operator&=(), llvm::operator<<(), llvm::DbgValueHistoryMap::trimLocationRanges(), and llvm::UnrollLoop().
|
static |
Definition at line 394 of file BasicBlockSections.cpp.
References assert(), llvm::SmallSet< T, N, C >::clear(), llvm::StringRef::consume_front(), llvm::StringRef::empty(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::getAsUnsignedInteger(), llvm::MemoryBuffer::getBufferIdentifier(), llvm::inconvertibleErrorCode(), llvm::SmallSet< T, N, C >::insert(), llvm::line_iterator::is_at_eof(), llvm::line_iterator::line_number(), llvm::SmallVectorBase< SmallVectorSizeType< T > >::size(), llvm::StringRef::split(), llvm::Error::success(), and llvm::StringMap< ValueTy, AllocatorTy >::try_emplace().
|
static |
Definition at line 191 of file BasicBlockSections.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::MachineFunction::getName(), llvm::MachineFunction::getNumBlockIDs(), and P.
INITIALIZE_PASS | ( | BasicBlockSections | , |
"bbsections-prepare" | , | ||
"Prepares for basic block | sections, | ||
by splitting functions " "into clusters of basic blocks." | , | ||
false | , | ||
false | |||
) | & |
SmallVector<MachineOperand, 4> Cond |
Definition at line 161 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::RISCVInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::AVRInstrInfo::analyzeBranch(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::R600InstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranch(), llvm::X86InstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranchImpl(), llvm::X86InstrInfo::analyzeBranchPredicate(), llvm::LanaiInstrInfo::analyzeSelect(), llvm::ARMBaseInstrInfo::analyzeSelect(), llvm::ARMTargetLowering::ARMTargetLowering(), llvm::CanonicalLoopInfo::assertOK(), buildNonAtomicBinOp(), buildPartialUnswitchConditionalBranch(), llvm::AArch64InstrInfo::canInsertSelect(), llvm::SIInstrInfo::canInsertSelect(), llvm::X86InstrInfo::canInsertSelect(), llvm::PPCInstrInfo::canInsertSelect(), CanProveNotTakenFirstIteration(), llvm::MachineBasicBlock::canSplitCriticalEdge(), checkBoolTestAndOrSetCCCombine(), checkDecodedInstruction(), combineBrCond(), combineCMov(), combineSelect(), combineSelectOfTwoConstants(), 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(), createShuffleMaskFromVSELECT(), llvm::parallel::detail::Latch::dec(), DecodeLDR(), dependsOnLocalPhi(), distributeOpThroughSelect(), eliminateDeadSwitchCases(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), EraseTerminatorAndDCECond(), llvm::Evaluator::EvaluateBlock(), llvm::VPReductionRecipe::execute(), findAffectedValues(), findLIVLoopCondition(), FindLoopCounter(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindWidenableTerminatorAboveLoop(), FixTail(), llvm::PeelingModuloScheduleExpander::fixupBranches(), llvm::CondOpInit::Fold(), foldBitCastSelect(), 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(), 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(), getX86XALUOOp(), handleOtherCmpSelSimplifications(), hasOnlySelectUsers(), llvm::BPFInstrInfo::insertBranch(), llvm::XCoreInstrInfo::insertBranch(), llvm::ARCInstrInfo::insertBranch(), llvm::NVPTXInstrInfo::insertBranch(), llvm::WebAssemblyInstrInfo::insertBranch(), llvm::RISCVInstrInfo::insertBranch(), llvm::MSP430InstrInfo::insertBranch(), llvm::MipsInstrInfo::insertBranch(), llvm::VEInstrInfo::insertBranch(), llvm::SparcInstrInfo::insertBranch(), llvm::AVRInstrInfo::insertBranch(), llvm::HexagonInstrInfo::insertBranch(), llvm::ARMBaseInstrInfo::insertBranch(), llvm::R600InstrInfo::insertBranch(), llvm::AArch64InstrInfo::insertBranch(), llvm::SystemZInstrInfo::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(), isGuaranteedNotToBeUndefOrPoison(), llvm::isImpliedByDomCondition(), isLoopNeverExecuted(), isProfitableToFoldUnconditional(), llvm::ISD::isTrueWhenEqual(), IsVPNOTEquivalent(), llvm::AMDGPULegalizerInfo::legalizeFrint(), llvm::AMDGPULegalizerInfo::legalizeUDIV_UREM32Impl(), LLVMSetCondition(), llvm::X86TargetLowering::LowerAsmOutputForConstraint(), llvm::LanaiTargetLowering::LowerBR_CC(), LowerBUILD_VECTORvXi1(), llvm::AMDGPUTargetLowering::LowerFRINT(), llvm::LanaiTargetLowering::LowerSELECT_CC(), llvm::LanaiTargetLowering::LowerSETCC(), LowerSETCCCARRY(), LowerShiftParts(), llvm::AMDGPUTargetLowering::LowerUDIVREM(), lowerVSELECTtoVectorShuffle(), LowerVSETCC(), LowerVSETCCWithSUBUS(), LowerXALUO(), ConditionalExpr::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(), PerformHeapAllocSRoA(), PerformHWLoopCombine(), performORCombine(), llvm::AMDGPUTargetLowering::performSelectCombine(), PerformVCMPCombine(), PerformVSELECTCombine(), llvm::HexagonInstrInfo::PredicateInstruction(), llvm::HexagonInstrInfo::predOpcodeHasNot(), prepareICWorklistFromFunction(), ConditionalExpr::printLeft(), llvm::JumpThreadingPass::processImpliedCondition(), processSwitch(), llvm::JumpThreadingPass::processThreadableEdges(), recordCondition(), replaceFoldableUses(), llvm::MSP430InstrInfo::reverseBranchCondition(), llvm::WebAssemblyInstrInfo::reverseBranchCondition(), llvm::RISCVInstrInfo::reverseBranchCondition(), llvm::MipsInstrInfo::reverseBranchCondition(), llvm::VEInstrInfo::reverseBranchCondition(), llvm::XCoreInstrInfo::reverseBranchCondition(), llvm::SparcInstrInfo::reverseBranchCondition(), llvm::ARCInstrInfo::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(), SinkCommonCodeFromPredecessors(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), llvm::MachineBasicBlock::SplitCriticalEdge(), splitEdge(), switchToSelect(), llvm::parallel::detail::Latch::sync(), ThreadCmpOverSelect(), transformToIndexedCompare(), llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(), unswitchBestCondition(), llvm::MachineBasicBlock::updateTerminator(), llvm::HexagonInstrInfo::validateBranchCond(), versionCallSite(), llvm::Interpreter::visitBranchInst(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), 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().
const SmallVector<MachineBasicBlock *, 4>& PreLayoutFallThroughs |
Definition at line 159 of file BasicBlockSections.cpp.
Referenced by for(), and llvm::sortBasicBlocksAndUpdateBranches().