LLVM: lib/CodeGen/MachineLICM.cpp File Reference (original) (raw)

Go to the source code of this file.

Functions
STATISTIC (NumHoisted, "Number of machine instructions hoisted out of loops")
STATISTIC (NumLowRP, "Number of instructions hoisted in low reg pressure situation")
STATISTIC (NumHighLatency, "Number of high latency instructions hoisted")
STATISTIC (NumCSEed, "Number of hoisted machine instructions CSEed")
STATISTIC (NumPostRAHoisted, "Number of machine instructions hoisted out of loops post regalloc")
STATISTIC (NumStoreConst, "Number of stores of const phys reg hoisted out of loops")
STATISTIC (NumNotHoistedDueToHotness, "Number of instructions not hoisted due to block frequency")
INITIALIZE_PASS_BEGIN (MachineLICM, DEBUG_TYPE, "Machine Loop Invariant Code Motion", false, false) INITIALIZE_PASS_END(MachineLICM
Machine Loop Invariant Code false INITIALIZE_PASS_BEGIN (EarlyMachineLICM, "early-machinelicm", "Early Machine Loop Invariant Code Motion", false, false) INITIALIZE_PASS_END(EarlyMachineLICM
static bool InstructionStoresToFI (const MachineInstr *MI, int FI)
Return true if instruction stores to the specified frame.
static void applyBitsNotInRegMaskToRegUnitsMask (const TargetRegisterInfo &TRI, BitVector &RUs, const uint32_t *Mask)
static bool isOperandKill (const MachineOperand &MO, MachineRegisterInfo *MRI)
static bool mayLoadFromGOTOrConstantPool (MachineInstr &MI)
Return true if this machine instruction loads from global offset table or constant pool.
static bool isInvariantStore (const MachineInstr &MI, const TargetRegisterInfo *TRI, const MachineRegisterInfo *MRI)
static bool isCopyFeedingInvariantStore (const MachineInstr &MI, const MachineRegisterInfo *MRI, const TargetRegisterInfo *TRI)
Variables
static cl::opt< bool > AvoidSpeculation ("avoid-speculation", cl::desc("MachineLICM should avoid speculation"), cl::init(true), cl::Hidden)
static cl::opt< bool > HoistCheapInsts ("hoist-cheap-insts", cl::desc("MachineLICM should hoist even cheap instructions"), cl::init(false), cl::Hidden)
static cl::opt< bool > HoistConstStores ("hoist-const-stores", cl::desc("Hoist invariant stores"), cl::init(true), cl::Hidden)
static cl::opt< bool > HoistConstLoads ("hoist-const-loads", cl::desc("Hoist invariant loads"), cl::init(true), cl::Hidden)
static cl::opt< unsigned > BlockFrequencyRatioThreshold ("block-freq-ratio-threshold", cl::desc("Do not hoist instructions if target" "block is N times hotter than the source."), cl::init(100), cl::Hidden)
static cl::opt< UseBFI > DisableHoistingToHotterBlocks ("disable-hoisting-to-hotter-blocks", cl::desc("Disable hoisting instructions to" " hotter blocks"), cl::init(UseBFI::PGO), cl::Hidden, cl::values(clEnumValN(UseBFI::None, "none", "disable the feature"), clEnumValN(UseBFI::PGO, "pgo", "enable the feature when using profile data"), clEnumValN(UseBFI::All, "all", "enable the feature with/wo profile data")))
DEBUG_TYPE
Machine Loop Invariant Code Motion
Machine Loop Invariant Code false
Machine Loop Invariant Code false early machinelicm

DEBUG_TYPE

#define DEBUG_TYPE "machinelicm"

GET_RESULT

| #define GET_RESULT | ( | | RESULT, | | ------------------- | - | | ------- | | | GETTER, | | | | | | INFIX | | | | | ) | | | |

Value:

((LegacyPass) \

? &LegacyPass->getAnalysis<RESULT##INFIX##WrapperPass>().GETTER() \

: &MFAM->getResult<RESULT##Analysis>(MF))

block Block Frequency Analysis

Definition at line 368 of file MachineLICM.cpp.

UseBFI

applyBitsNotInRegMaskToRegUnitsMask()

INITIALIZE_PASS_BEGIN() [1/2]

Machine Loop Invariant Code false INITIALIZE_PASS_BEGIN ( EarlyMachineLICM ,
"early-machinelicm" ,
"Early Machine Loop Invariant Code Motion" ,
false ,
false
)

INITIALIZE_PASS_BEGIN() [2/2]

INITIALIZE_PASS_BEGIN ( MachineLICM ,
DEBUG_TYPE ,
"Machine Loop Invariant Code Motion" ,
false ,
false
)

InstructionStoresToFI()

Return true if instruction stores to the specified frame.

Definition at line 438 of file MachineLICM.cpp.

References MI.

isCopyFeedingInvariantStore()

isInvariantStore()

isOperandKill()

mayLoadFromGOTOrConstantPool()

Return true if this machine instruction loads from global offset table or constant pool.

Definition at line 1017 of file MachineLICM.cpp.

References assert(), and MI.

STATISTIC() [1/7]

STATISTIC ( NumCSEed ,
"Number of hoisted machine instructions CSEed"
)

STATISTIC() [2/7]

STATISTIC ( NumHighLatency ,
"Number of high latency instructions hoisted"
)

STATISTIC() [3/7]

STATISTIC ( NumHoisted ,
"Number of machine instructions hoisted out of loops"
)

STATISTIC() [4/7]

STATISTIC ( NumLowRP ,
"Number of instructions hoisted in low reg pressure situation"
)

STATISTIC() [5/7]

STATISTIC ( NumNotHoistedDueToHotness ,
"Number of instructions not hoisted due to block frequency"
)

STATISTIC() [6/7]

STATISTIC ( NumPostRAHoisted ,
"Number of machine instructions hoisted out of loops post regalloc"
)

STATISTIC() [7/7]

STATISTIC ( NumStoreConst ,
"Number of stores of const phys reg hoisted out of loops"
)

AvoidSpeculation

cl::opt< bool > AvoidSpeculation("avoid-speculation", cl::desc("MachineLICM should avoid speculation"), cl::init(true), cl::Hidden) ( "avoid-speculation" , cl::desc("MachineLICM should avoid speculation") , cl::init(true) , cl::Hidden ) static

BlockFrequencyRatioThreshold

DEBUG_TYPE

DisableHoistingToHotterBlocks

cl::opt< UseBFI > DisableHoistingToHotterBlocks("disable-hoisting-to-hotter-blocks", cl::desc("Disable hoisting instructions to" " hotter blocks"), cl::init(UseBFI::PGO), cl::Hidden, cl::values(clEnumValN(UseBFI::None, "none", "disable the feature"), clEnumValN(UseBFI::PGO, "pgo", "enable the feature when using profile data"), clEnumValN(UseBFI::All, "all", "enable the feature with/wo profile data"))) ( "disable-hoisting-to-hotter-blocks" , cl::desc("Disable hoisting instructions to" " hotter blocks") , cl::init(UseBFI::PGO) , cl::Hidden , cl::values(clEnumValN(UseBFI::None, "none", "disable the feature"), clEnumValN(UseBFI::PGO, "pgo", "enable the feature when using profile data"), clEnumValN(UseBFI::All, "all", "enable the feature with/wo profile data")) ) static

false

HoistCheapInsts

cl::opt< bool > HoistCheapInsts("hoist-cheap-insts", cl::desc("MachineLICM should hoist even cheap instructions"), cl::init(false), cl::Hidden) ( "hoist-cheap-insts" , cl::desc("MachineLICM should hoist even cheap instructions") , cl::init(false) , cl::Hidden ) static

HoistConstLoads

HoistConstStores

Motion