LLVM  3.7.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)
 LoopIsOuterMostWithPredecessor - Test if the given loop is the outer-most loop that has a unique predecessor. More...
 
static bool InstructionStoresToFI (const MachineInstr *MI, int FI)
 InstructionStoresToFI - Return true if instruction stores to the specified frame. More...
 
static bool isOperandKill (const MachineOperand &MO, MachineRegisterInfo *MRI)
 
static bool isLoadFromGOTOrConstantPool (MachineInstr &MI)
 isLoadFromGOTOrConstantPool - 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

InstructionStoresToFI - Return true if instruction stores to the specified frame.

Definition at line 407 of file MachineLICM.cpp.

References llvm::MachineInstr::memoperands_begin(), and llvm::MachineInstr::memoperands_end().

static bool isLoadFromGOTOrConstantPool ( MachineInstr MI)
static

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

Definition at line 920 of file MachineLICM.cpp.

References I, llvm::MachineInstr::mayLoad(), llvm::MachineInstr::memoperands_begin(), and llvm::MachineInstr::memoperands_end().

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

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

Definition at line 324 of file MachineLICM.cpp.

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

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 319 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 319 of file MachineLICM.cpp.

Machine Loop Invariant Code Motion

Definition at line 319 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