|
LLVM 24.0.0git
|
#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringRef.h"#include "llvm/Analysis/EHUtils.h"#include "llvm/Analysis/ProfileSummaryInfo.h"#include "llvm/CodeGen/BasicBlockMatchingAndInference.h"#include "llvm/CodeGen/BasicBlockSectionUtils.h"#include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"#include "llvm/CodeGen/MachineDominators.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachinePostDominators.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/TargetInstrInfo.h"#include "llvm/IR/Function.h"#include "llvm/InitializePasses.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/UniqueBBID.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Transforms/Utils/CodeLayout.h"#include <optional>Go to the source code of this file.
Functions | |
| INITIALIZE_PASS_BEGIN (BasicBlockSections, "bbsections-prepare", "Prepares for basic block sections, by splitting functions " "into clusters of basic blocks.", false, false) INITIALIZE_PASS_END(BasicBlockSections | |
| bbsections Prepares for basic block by splitting functions into clusters of basic static false void | updateBranches (MachineFunction &MF, const SmallVector< MachineBasicBlock * > &PreLayoutFallThroughs) |
| static SmallVector< BBClusterInfo > | createBBClusterInfoForFunction (MachineFunction &MF, const BasicBlockMatchingAndInference &BMI) |
| static void | assignSections (MachineFunction &MF, const DenseMap< UniqueBBID, BBClusterInfo > &FuncClusterInfo) |
| static void | setDescendantEHBlocksCold (MachineFunction &MF) |
| setDescendantEHBlocksCold - This splits all EH pads and blocks reachable only by EH pad as cold. | |
| static bool | isColdBlock (const MachineBasicBlock &MBB, const MachineBlockFrequencyInfo *MBFI, ProfileSummaryInfo *PSI) |
Variables | |
| static 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) |
| static cl::opt< unsigned > | PercentileCutoff ("mfs-psi-cutoff", cl::desc("Percentile profile summary cutoff used to " "determine cold blocks. Unused if set to zero."), cl::init(999950), cl::Hidden) |
| static cl::opt< unsigned > | ColdCountThreshold ("mfs-count-threshold", cl::desc("Minimum number of times a block must be executed to be retained."), cl::init(1), cl::Hidden) |
| static cl::opt< bool > | SplitAllEHCode ("mfs-split-ehcode", cl::desc("Splits all EH code and it's descendants by default."), cl::init(false), cl::Hidden) |
| bbsections | prepare |
| bbsections Prepares for basic block | sections |
| bbsections Prepares for basic block by splitting functions into clusters of basic | blocks |
| bbsections Prepares for basic block by splitting functions into clusters of basic | false |
|
static |
Definition at line 316 of file BasicBlockSections.cpp.
References llvm::All, assert(), llvm::MBBSectionID::ColdSectionID, llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::MBBSectionID::ExceptionSectionID, llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::TargetOptions::FunctionSplitting, llvm::TargetMachine::getBBSectionsType(), llvm::MachineFunction::getTarget(), llvm::MachineFunction::hasBBSections(), I, llvm::List, MBB, llvm::None, llvm::TargetMachine::Options, and TII.
|
static |
Definition at line 238 of file BasicBlockSections.cpp.
References llvm::Block, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MachineFunction::getName(), llvm::BasicBlockMatchingAndInference::getWeightInfo(), llvm::instructionsWithoutDebug(), MBB, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineFunction::RenumberBlocks(), llvm::MachineFunction::size(), and uint64_t.
| INITIALIZE_PASS_BEGIN | ( | BasicBlockSections | , |
| "bbsections-prepare" | , | ||
| "Prepares for basic block | sections, | ||
| by splitting functions " "into clusters of basic blocks." | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_DEPENDENCY.
|
static |
Definition at line 445 of file BasicBlockSections.cpp.
References ColdCountThreshold, llvm::Count, llvm::MachineBlockFrequencyInfo::getBlockProfileCount(), llvm::ProfileSummaryInfo::hasCSInstrumentationProfile(), llvm::ProfileSummaryInfo::hasInstrumentationProfile(), llvm::ProfileSummaryInfo::hasSampleProfile(), llvm::ProfileSummaryInfo::isColdCountNthPercentile(), MBB, and PercentileCutoff.
|
static |
setDescendantEHBlocksCold - This splits all EH pads and blocks reachable only by EH pad as cold.
This will help mark EH pads statically cold instead of relying on profile data.
Definition at line 437 of file BasicBlockSections.cpp.
References llvm::Block, llvm::MBBSectionID::ColdSectionID, and llvm::computeEHOnlyBlocks().
|
static |
Definition at line 203 of file BasicBlockSections.cpp.
References Cond, const, MBB, TBB, TII, and updateBranches().
Referenced by llvm::sortBasicBlocksAndUpdateBranches(), updateBranches(), and updatePredecessors().
|
static |
Referenced by llvm::hasInstrProfHashMismatch().
Definition at line 197 of file BasicBlockSections.cpp.
Referenced by blake3_hash16_avx512(), blake3_hash4_avx512(), blake3_hash4_sse2(), blake3_hash4_sse41(), blake3_hash8_avx2(), blake3_hash8_avx512(), blake3_hash_many(), blake3_hash_many_avx2(), blake3_hash_many_avx512(), blake3_hash_many_portable(), blake3_hash_many_sse2(), blake3_hash_many_sse41(), llvm::GCOVBlock::getCyclesCount(), llvm::LoopBase< BlockT, LoopT >::getExitBlocks(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::LoopBase< BlockT, LoopT >::getExitingBlocks(), hash_one_avx512(), hash_one_portable(), hash_one_sse2(), hash_one_sse41(), and llvm::RegionBase< Tr >::print().
|
static |
Definition at line 198 of file BasicBlockSections.cpp.
|
static |
Referenced by isColdBlock(), llvm::ProfileSummaryInfo::isColdBlockNthPercentile(), llvm::ProfileSummaryInfo::isColdBlockNthPercentile(), llvm::ProfileSummaryInfo::isColdCountNthPercentile(), llvm::ProfileSummaryInfo::isFunctionColdInCallGraphNthPercentile(), llvm::ProfileSummaryInfo::isFunctionHotInCallGraphNthPercentile(), llvm::ProfileSummaryInfo::isHotBlockNthPercentile(), llvm::ProfileSummaryInfo::isHotBlockNthPercentile(), and llvm::ProfileSummaryInfo::isHotCountNthPercentile().
| bbsections prepare |
Definition at line 195 of file BasicBlockSections.cpp.
Referenced by llvm::jitlink::ELFLinkGraphBuilder< ELFT >::buildGraph().
Definition at line 196 of file BasicBlockSections.cpp.
Referenced by llvm::object::ELFFile< ELFT >::dynamicEntries(), llvm::object::ELFFile< ELFT >::getDynSymtabSize(), llvm::object::ELFFile< ELFT >::getSection(), llvm::object::ELFFile< ELFT >::getSectionAndRelocations(), llvm::object::ELFFile< ELFT >::getSectionName(), llvm::object::ELFFile< ELFT >::getSHNDXTable(), llvm::object::ELFFile< ELFT >::getStringTableForSymtab(), llvm::pdb::InputFile::hasTypes(), and LLVMObjectFileCopySectionIterator().