LLVM 20.0.0git
Functions | Variables
MachineFunctionSplitter.cpp File Reference
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/EHUtils.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/CodeGen/BasicBlockSectionUtils.h"
#include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.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/IR/Function.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include <optional>

Go to the source code of this file.

Functions

static void setDescendantEHBlocksCold (MachineFunction &MF)
 setDescendantEHBlocksCold - This splits all EH pads and blocks reachable only by EH pad as cold.
 
static void finishAdjustingBasicBlocksAndLandingPads (MachineFunction &MF)
 
static bool isColdBlock (const MachineBasicBlock &MBB, const MachineBlockFrequencyInfo *MBFI, ProfileSummaryInfo *PSI)
 
 INITIALIZE_PASS (MachineFunctionSplitter, "machine-function-splitter", "Split machine functions using profile information", false, false) MachineFunctionPass *llvm
 

Variables

static cl::opt< unsignedPercentileCutoff ("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< unsignedColdCountThreshold ("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< boolSplitAllEHCode ("mfs-split-ehcode", cl::desc("Splits all EH code and it's descendants by default."), cl::init(false), cl::Hidden)
 

Function Documentation

◆ finishAdjustingBasicBlocksAndLandingPads()

static void finishAdjustingBasicBlocksAndLandingPads ( MachineFunction MF)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( MachineFunctionSplitter  ,
"machine-function-splitter"  ,
"Split machine functions using profile information"  ,
false  ,
false   
)

Definition at line 220 of file MachineFunctionSplitter.cpp.

◆ isColdBlock()

static bool isColdBlock ( const MachineBasicBlock MBB,
const MachineBlockFrequencyInfo MBFI,
ProfileSummaryInfo PSI 
)
static

◆ setDescendantEHBlocksCold()

static void setDescendantEHBlocksCold ( MachineFunction MF)
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 92 of file MachineFunctionSplitter.cpp.

References llvm::Block, llvm::MBBSectionID::ColdSectionID, and llvm::computeEHOnlyBlocks().

Variable Documentation

◆ ColdCountThreshold

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) ( "mfs-count-threshold"  ,
cl::desc( "Minimum number of times a block must be executed to be retained.")  ,
cl::init(1)  ,
cl::Hidden   
)
static

◆ PercentileCutoff

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) ( "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

◆ SplitAllEHCode

cl::opt< bool > SplitAllEHCode("mfs-split-ehcode", cl::desc("Splits all EH code and it's descendants by default."), cl::init(false), cl::Hidden) ( "mfs-split-ehcode"  ,
cl::desc("Splits all EH code and it's descendants by default.")  ,
cl::init(false)  ,
cl::Hidden   
)
static