LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::LiveIntervals Class Reference

#include <LiveIntervalAnalysis.h>

Inheritance diagram for llvm::LiveIntervals:

Inheritance graph
[legend]
Collaboration diagram for llvm::LiveIntervals:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

Definition at line 33 of file LiveIntervalAnalysis.h.


Member Typedef Documentation

typedef Reg2IntervalMap::const_iterator llvm::LiveIntervals::const_iterator
 

Definition at line 85 of file LiveIntervalAnalysis.h.

typedef Reg2IntervalMap::iterator llvm::LiveIntervals::iterator
 

Definition at line 84 of file LiveIntervalAnalysis.h.


Member Function Documentation

std::vector< LiveInterval * > LiveIntervals::addIntervalsForSpills (  const LiveInterval &  i,
VirtRegMap &  vrm,
int  slot
) 
 

Definition at line 189 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::MachineOperand::getReg(), llvm::SSARegMap::getRegClass(), llvm::MachineFunction::getSSARegMap(), getStoreIndex(), getUseIndex(), llvm::VirtRegMap::grow(), index, llvm::MachineBasicBlock::insert(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isRegister(), llvm::MachineOperand::isUse(), llvm::LiveIntervals::InstrSlots::NUM, numFolded, llvm::LiveInterval::ranges, llvm::LiveInterval::reg, llvm::VirtRegMap::virtFolded(), and llvm::LiveInterval::weight.

iterator llvm::LiveIntervals::begin (   )  [inline]
 

Definition at line 88 of file LiveIntervalAnalysis.h.

const_iterator llvm::LiveIntervals::begin (   )  const [inline]
 

Definition at line 86 of file LiveIntervalAnalysis.h.

Referenced by print(), and runOnMachineFunction().

iterator llvm::LiveIntervals::end (   )  [inline]
 

Definition at line 89 of file LiveIntervalAnalysis.h.

const_iterator llvm::LiveIntervals::end (   )  const [inline]
 

Definition at line 87 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 63 of file LiveIntervalAnalysis.cpp.

References llvm::AnalysisUsage::addPreserved(), 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 65 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 68 of file LiveIntervalAnalysis.h.

References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::NUM.

static unsigned llvm::LiveIntervals::getDefIndex (  unsigned  index  )  [inline, static]
 

Definition at line 77 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 113 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 105 of file LiveIntervalAnalysis.h.

Referenced by print().

const LiveInterval& llvm::LiveIntervals::getInterval (  unsigned  reg  )  const [inline]
 

Definition at line 98 of file LiveIntervalAnalysis.h.

References I.

LiveInterval& llvm::LiveIntervals::getInterval (  unsigned  reg  )  [inline]
 

Definition at line 92 of file LiveIntervalAnalysis.h.

References I.

Referenced by runOnMachineFunction().

static unsigned llvm::LiveIntervals::getLoadIndex (  unsigned  index  )  [inline, static]
 

Definition at line 71 of file LiveIntervalAnalysis.h.

References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::LOAD.

Referenced by addIntervalsForSpills().

unsigned llvm::LiveIntervals::getNumIntervals (   )  const [inline]
 

Definition at line 90 of file LiveIntervalAnalysis.h.

Referenced by runOnMachineFunction().

static unsigned llvm::LiveIntervals::getStoreIndex (  unsigned  index  )  [inline, static]
 

Definition at line 80 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 74 of file LiveIntervalAnalysis.h.

References getBaseIndex(), and llvm::LiveIntervals::InstrSlots::USE.

Referenced by addIntervalsForSpills().

void LiveIntervals::print (  std::ostream &  O  )  const [virtual]
 

print - Implement the dump method.

Reimplemented from llvm::Pass.

Definition at line 172 of file LiveIntervalAnalysis.cpp.

References llvm::MachineFunction::begin(), begin(), E, llvm::MachineFunction::end(), end(), getInstructionIndex(), 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 llvm::MachineBasicBlock::begin(), begin(), llvm::MachineFunction::begin(), DEBUG, llvm::Pass::dump(), E, EnableJoining, llvm::MachineBasicBlock::end(), end(), llvm::MachineFunction::end(), F, llvm::MRegisterInfo::getAllocatableSet(), llvm::MachineBasicBlock::getBasicBlock(), llvm::TargetMachine::getInstrInfo(), getInterval(), llvm::SSARegMap::getLastVirtReg(), llvm::LoopInfo::getLoopDepth(), getNumIntervals(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getSSARegMap(), llvm::MachineFunction::getTarget(), llvm::DenseMap< T, ToIndexT >::grow(), I, llvm::MachineOperand::isDef(), llvm::TargetInstrInfo::isMoveInstr(), llvm::MachineOperand::isRegister(), llvm::MachineOperand::isUse(), llvm::MRegisterInfo::isVirtualRegister(), llvm::LiveIntervals::InstrSlots::NUM, numIntervals, numIntervalsAfter, numPeep, and llvm::LiveInterval::weight.


The documentation for this class was generated from the following files: