LLVM API Documentation
#include <LiveIntervalAnalysis.h>
Inheritance diagram for llvm::LiveIntervals:
Public Types | |
typedef Reg2IntervalMap::iterator | iterator |
typedef Reg2IntervalMap::const_iterator | const_iterator |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
unsigned | getNumIntervals () const |
LiveInterval & | getInterval (unsigned reg) |
const LiveInterval & | getInterval (unsigned reg) const |
unsigned | getInstructionIndex (MachineInstr *instr) const |
getInstructionIndex - returns the base index of instr | |
MachineInstr * | getInstructionFromIndex (unsigned index) const |
std::vector< LiveInterval * > | addIntervalsForSpills (const LiveInterval &i, VirtRegMap &vrm, int slot) |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
virtual void | releaseMemory () |
virtual bool | runOnMachineFunction (MachineFunction &) |
runOnMachineFunction - pass entry point | |
virtual void | print (std::ostream &O, const Module *=0) const |
print - Implement the dump method. | |
Static Public Member Functions | |
static unsigned | getBaseIndex (unsigned index) |
static unsigned | getBoundaryIndex (unsigned index) |
static unsigned | getLoadIndex (unsigned index) |
static unsigned | getUseIndex (unsigned index) |
static unsigned | getDefIndex (unsigned index) |
static unsigned | getStoreIndex (unsigned index) |
Classes | |
struct | InstrSlots |
Definition at line 34 of file LiveIntervalAnalysis.h.
typedef Reg2IntervalMap::const_iterator llvm::LiveIntervals::const_iterator |
Definition at line 87 of file LiveIntervalAnalysis.h.
Definition at line 86 of file LiveIntervalAnalysis.h.
std::vector< LiveInterval * > LiveIntervals::addIntervalsForSpills | ( | const LiveInterval & | i, | |
VirtRegMap & | vrm, | |||
int | slot | |||
) |
Definition at line 226 of file LiveIntervalAnalysis.cpp.
References llvm::LiveInterval::addRange(), llvm::LiveVariables::addVirtualRegisterKilled(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::SSARegMap::createVirtualRegister(), DEBUG, llvm::LiveInterval::empty(), end(), llvm::MachineBasicBlock::erase(), llvm::MRegisterInfo::foldMemoryOperand(), getBaseIndex(), getDefIndex(), getInstructionFromIndex(), getLoadIndex(), llvm::LiveInterval::getNextValue(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::SSARegMap::getRegClass(), llvm::MachineFunction::getSSARegMap(), getStoreIndex(), getUseIndex(), llvm::VirtRegMap::grow(), index, llvm::MachineBasicBlock::insert(), MBB, MI, llvm::LiveIntervals::InstrSlots::NUM, numFolded, llvm::LiveInterval::ranges, llvm::LiveInterval::reg, llvm::MachineInstr::SetMachineOperandReg(), llvm::VirtRegMap::virtFolded(), and llvm::LiveInterval::weight.
iterator llvm::LiveIntervals::begin | ( | ) | [inline] |
Definition at line 90 of file LiveIntervalAnalysis.h.
const_iterator llvm::LiveIntervals::begin | ( | ) | const [inline] |
Definition at line 88 of file LiveIntervalAnalysis.h.
Referenced by print(), and runOnMachineFunction().
iterator llvm::LiveIntervals::end | ( | ) | [inline] |
Definition at line 91 of file LiveIntervalAnalysis.h.
const_iterator llvm::LiveIntervals::end | ( | ) | const [inline] |
Definition at line 89 of file LiveIntervalAnalysis.h.
Referenced by addIntervalsForSpills(), print(), and runOnMachineFunction().
void LiveIntervals::getAnalysisUsage | ( | AnalysisUsage & | AU | ) | const [virtual] |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 64 of file LiveIntervalAnalysis.cpp.
References llvm::AnalysisUsage::addPreservedID(), llvm::AnalysisUsage::addRequired(), llvm::AnalysisUsage::addRequiredID(), llvm::Pass::getAnalysisUsage(), llvm::PHIEliminationID, and llvm::TwoAddressInstructionPassID.
static unsigned llvm::LiveIntervals::getBaseIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 67 of file LiveIntervalAnalysis.h.
References llvm::LiveIntervals::InstrSlots::NUM.
Referenced by addIntervalsForSpills(), getBoundaryIndex(), getDefIndex(), getLoadIndex(), getStoreIndex(), and getUseIndex().
static unsigned llvm::LiveIntervals::getBoundaryIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 70 of file LiveIntervalAnalysis.h.
References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::NUM.
static unsigned llvm::LiveIntervals::getDefIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 79 of file LiveIntervalAnalysis.h.
References llvm::LiveIntervals::InstrSlots::DEF, and getBaseIndex().
Referenced by addIntervalsForSpills().
MachineInstr* llvm::LiveIntervals::getInstructionFromIndex | ( | unsigned | index | ) | const [inline] |
getInstructionFromIndex - given an index in any slot of an instruction return a pointer the instruction
Definition at line 115 of file LiveIntervalAnalysis.h.
References llvm::LiveIntervals::InstrSlots::NUM.
Referenced by addIntervalsForSpills().
unsigned llvm::LiveIntervals::getInstructionIndex | ( | MachineInstr * | instr | ) | const [inline] |
getInstructionIndex - returns the base index of instr
Definition at line 107 of file LiveIntervalAnalysis.h.
Referenced by print().
const LiveInterval& llvm::LiveIntervals::getInterval | ( | unsigned | reg | ) | const [inline] |
LiveInterval& llvm::LiveIntervals::getInterval | ( | unsigned | reg | ) | [inline] |
Definition at line 94 of file LiveIntervalAnalysis.h.
References I.
Referenced by runOnMachineFunction().
static unsigned llvm::LiveIntervals::getLoadIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 73 of file LiveIntervalAnalysis.h.
References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::LOAD.
Referenced by addIntervalsForSpills().
unsigned llvm::LiveIntervals::getNumIntervals | ( | ) | const [inline] |
static unsigned llvm::LiveIntervals::getStoreIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 82 of file LiveIntervalAnalysis.h.
References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::STORE.
Referenced by addIntervalsForSpills().
static unsigned llvm::LiveIntervals::getUseIndex | ( | unsigned | index | ) | [inline, static] |
Definition at line 76 of file LiveIntervalAnalysis.h.
References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::USE.
Referenced by addIntervalsForSpills().
void LiveIntervals::print | ( | std::ostream & | O, | |
const Module * | = 0 | |||
) | const [virtual] |
print - Implement the dump method.
Reimplemented from llvm::Pass.
Definition at line 207 of file LiveIntervalAnalysis.cpp.
References llvm::MachineFunction::begin(), begin(), E, llvm::MachineFunction::end(), end(), getInstructionIndex(), llvm::Intrinsic::getName(), and I.
void LiveIntervals::releaseMemory | ( | ) | [virtual] |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 74 of file LiveIntervalAnalysis.cpp.
References llvm::DenseMap< T, ToIndexT >::clear().
bool LiveIntervals::runOnMachineFunction | ( | MachineFunction & | fn | ) | [virtual] |
runOnMachineFunction - pass entry point
runOnMachineFunction - Register allocate the whole function
Implements llvm::MachineFunctionPass.
Definition at line 85 of file LiveIntervalAnalysis.cpp.
References begin(), llvm::MachineFunction::begin(), llvm::MRegisterInfo::copyRegToReg(), DEBUG, llvm::Pass::dump(), E, EnableJoining, end(), llvm::MachineFunction::end(), F, llvm::MRegisterInfo::getAliasSet(), llvm::MRegisterInfo::getAllocatableSet(), llvm::TargetMachine::getInstrInfo(), getInterval(), llvm::SSARegMap::getLastVirtReg(), llvm::LoopInfo::getLoopDepth(), getNumIntervals(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getSSARegMap(), llvm::MachineFunction::getTarget(), llvm::DenseMap< T, ToIndexT >::grow(), I, llvm::TargetInstrInfo::isMoveInstr(), llvm::MRegisterInfo::isVirtualRegister(), llvm::MachineFunction::livein_begin(), llvm::MachineFunction::livein_end(), llvm::LiveIntervals::InstrSlots::NUM, numIntervals, numIntervalsAfter, numPeep, RC, llvm::MRegisterInfo::regclass_begin(), llvm::MRegisterInfo::regclass_end(), and llvm::LiveInterval::weight.