LLVM  4.0.0
Macros | Functions | Variables
MachineLICM.cpp File Reference
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
Include dependency graph for MachineLICM.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "machine-licm"
 

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")
 
 INITIALIZE_PASS_BEGIN (MachineLICM,"machinelicm","Machine Loop Invariant Code Motion", false, false) INITIALIZE_PASS_END(MachineLICM
 
Machine Loop Invariant Code
static false bool 
LoopIsOuterMostWithPredecessor (MachineLoop *CurLoop)
 Test if the given loop is the outer-most loop that has a unique predecessor. More...
 
static bool InstructionStoresToFI (const MachineInstr *MI, int FI)
 Return true if instruction stores to the specified frame. More...
 
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. More...
 

Variables

static cl::opt< boolAvoidSpeculation ("avoid-speculation", cl::desc("MachineLICM should avoid speculation"), cl::init(true), cl::Hidden)
 
static cl::opt< boolHoistCheapInsts ("hoist-cheap-insts", cl::desc("MachineLICM should hoist even cheap instructions"), cl::init(false), cl::Hidden)
 
static cl::opt< boolSinkInstsToAvoidSpills ("sink-insts-to-avoid-spills", cl::desc("MachineLICM should sink instructions into ""loops to avoid register spills"), cl::init(false), cl::Hidden)
 
 machinelicm
 
Machine Loop Invariant Code Motion
 
Machine Loop Invariant Code false
 

Macro Definition Documentation

#define DEBUG_TYPE   "machine-licm"

Definition at line 41 of file MachineLICM.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( MachineLICM  ,
"machinelicm"  ,
"Machine Loop Invariant Code Motion ,
false  ,
false   
)
static bool InstructionStoresToFI ( const MachineInstr MI,
int  FI 
)
static

Return true if instruction stores to the specified frame.

Definition at line 331 of file MachineLICM.cpp.

References llvm::MachineInstr::memoperands(), and llvm::MachineInstr::memoperands_empty().

static bool isOperandKill ( const MachineOperand MO,
MachineRegisterInfo MRI 
)
static
Machine Loop Invariant Code static false bool LoopIsOuterMostWithPredecessor ( MachineLoop CurLoop)
static

Test if the given loop is the outer-most loop that has a unique predecessor.

Definition at line 249 of file MachineLICM.cpp.

References llvm::LoopBase< N, M >::getLoopPredecessor(), llvm::LoopBase< N, M >::getParentLoop(), and L.

static bool mayLoadFromGOTOrConstantPool ( MachineInstr MI)
static

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

Definition at line 838 of file MachineLICM.cpp.

References assert(), llvm::MachineInstr::mayLoad(), llvm::MachineInstr::memoperands(), and llvm::MachineInstr::memoperands_empty().

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

Variable Documentation

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

Definition at line 245 of file MachineLICM.cpp.

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

Definition at line 245 of file MachineLICM.cpp.

Machine Loop Invariant Code Motion

Definition at line 245 of file MachineLICM.cpp.

cl::opt<bool> SinkInstsToAvoidSpills("sink-insts-to-avoid-spills", cl::desc("MachineLICM should sink instructions into ""loops to avoid register spills"), cl::init(false), cl::Hidden)
static