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::LiveVariables Class Reference

#include <LiveVariables.h>

Inheritance diagram for llvm::LiveVariables:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::multimap< MachineInstr *,
unsigned >::iterator 
killed_iterator

Public Member Functions

virtual bool runOnMachineFunction (MachineFunction &MF)
killed_iterator killed_begin (MachineInstr *MI)
killed_iterator killed_end (MachineInstr *MI)
std::pair< killed_iterator,
killed_iterator
killed_range (MachineInstr *MI)
killed_iterator dead_begin (MachineInstr *MI)
killed_iterator dead_end (MachineInstr *MI)
std::pair< killed_iterator,
killed_iterator
dead_range (MachineInstr *MI)
void instructionChanged (MachineInstr *OldMI, MachineInstr *NewMI)
void addVirtualRegisterKilled (unsigned IncomingReg, MachineInstr *MI)
bool removeVirtualRegisterKilled (unsigned reg, MachineBasicBlock *MBB, MachineInstr *MI)
void removeVirtualRegistersKilled (killed_iterator B, killed_iterator E)
void addVirtualRegisterDead (unsigned IncomingReg, MachineInstr *MI)
bool removeVirtualRegisterDead (unsigned reg, MachineBasicBlock *MBB, MachineInstr *MI)
void removeVirtualRegistersDead (killed_iterator B, killed_iterator E)
virtual void getAnalysisUsage (AnalysisUsage &AU) const
virtual void releaseMemory ()
VarInfogetVarInfo (unsigned RegIdx)
void MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *BB)
void HandleVirtRegUse (VarInfo &VRInfo, MachineBasicBlock *MBB, MachineInstr *MI)

Classes

struct  VarInfo

Detailed Description

Definition at line 39 of file LiveVariables.h.


Member Typedef Documentation

typedef std::multimap<MachineInstr*, unsigned>::iterator llvm::LiveVariables::killed_iterator
 

killed_iterator - Iterate over registers killed by a machine instruction

Definition at line 113 of file LiveVariables.h.


Member Function Documentation

void llvm::LiveVariables::addVirtualRegisterDead unsigned  IncomingReg,
MachineInstr MI
[inline]
 

addVirtualRegisterDead - Add information about the fact that the specified register is dead after being used by the specified instruction.

Definition at line 188 of file LiveVariables.h.

References getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.

void llvm::LiveVariables::addVirtualRegisterKilled unsigned  IncomingReg,
MachineInstr MI
[inline]
 

addVirtualRegisterKilled - Add information about the fact that the specified register is killed after being used by the specified instruction.

Definition at line 152 of file LiveVariables.h.

References getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.

Referenced by llvm::LiveIntervals::addIntervalsForSpills().

killed_iterator llvm::LiveVariables::dead_begin MachineInstr MI  )  [inline]
 

Definition at line 128 of file LiveVariables.h.

killed_iterator llvm::LiveVariables::dead_end MachineInstr MI  )  [inline]
 

Definition at line 131 of file LiveVariables.h.

std::pair<killed_iterator, killed_iterator> llvm::LiveVariables::dead_range MachineInstr MI  )  [inline]
 

Definition at line 135 of file LiveVariables.h.

Referenced by instructionChanged().

virtual void llvm::LiveVariables::getAnalysisUsage AnalysisUsage AU  )  const [inline, 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 220 of file LiveVariables.h.

References llvm::AnalysisUsage::setPreservesAll().

LiveVariables::VarInfo & LiveVariables::getVarInfo unsigned  RegIdx  ) 
 

getVarInfo - Return the VarInfo structure for the specified VIRTUAL register.

Definition at line 41 of file LiveVariables.cpp.

References llvm::MRegisterInfo::FirstVirtualRegister, and llvm::MRegisterInfo::isVirtualRegister().

Referenced by addVirtualRegisterDead(), addVirtualRegisterKilled(), instructionChanged(), removeVirtualRegisterDead(), removeVirtualRegisterKilled(), removeVirtualRegistersDead(), removeVirtualRegistersKilled(), and runOnMachineFunction().

void LiveVariables::HandleVirtRegUse VarInfo VRInfo,
MachineBasicBlock MBB,
MachineInstr MI
 

Definition at line 84 of file LiveVariables.cpp.

References llvm::LiveVariables::VarInfo::DefInst, E, llvm::MachineInstr::getParent(), llvm::LiveVariables::VarInfo::Kills, MarkVirtRegAliveInBlock(), llvm::MachineBasicBlock::pred_begin(), and llvm::MachineBasicBlock::pred_end().

Referenced by runOnMachineFunction().

void LiveVariables::instructionChanged MachineInstr OldMI,
MachineInstr NewMI
 

instructionChanged - When the address of an instruction changes, this method should be called so that live variables can update its internal data structures. This removes the records for OldMI, transfering them to the records for NewMI.

Definition at line 299 of file LiveVariables.cpp.

References dead_range(), llvm::LiveVariables::VarInfo::DefInst, E, llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getVarInfo(), I, llvm::MachineOperand::isDef(), llvm::MachineOperand::isRegister(), llvm::MRegisterInfo::isVirtualRegister(), killed_range(), and llvm::tie().

killed_iterator llvm::LiveVariables::killed_begin MachineInstr MI  )  [inline]
 

killed_begin/end - Get access to the range of registers killed by a machine instruction.

Definition at line 117 of file LiveVariables.h.

Referenced by removeVirtualRegisterDead(), and removeVirtualRegisterKilled().

killed_iterator llvm::LiveVariables::killed_end MachineInstr MI  )  [inline]
 

Definition at line 120 of file LiveVariables.h.

Referenced by removeVirtualRegisterDead(), and removeVirtualRegisterKilled().

std::pair<killed_iterator, killed_iterator> llvm::LiveVariables::killed_range MachineInstr MI  )  [inline]
 

Definition at line 124 of file LiveVariables.h.

Referenced by instructionChanged().

void LiveVariables::MarkVirtRegAliveInBlock VarInfo VRInfo,
MachineBasicBlock BB
 

Definition at line 56 of file LiveVariables.cpp.

References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::LiveVariables::VarInfo::DefInst, E, llvm::MachineBasicBlock::getNumber(), llvm::MachineInstr::getParent(), llvm::LiveVariables::VarInfo::Kills, llvm::MachineBasicBlock::pred_begin(), and llvm::MachineBasicBlock::pred_end().

Referenced by HandleVirtRegUse(), and runOnMachineFunction().

virtual void llvm::LiveVariables::releaseMemory  )  [inline, 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 224 of file LiveVariables.h.

bool llvm::LiveVariables::removeVirtualRegisterDead unsigned  reg,
MachineBasicBlock MBB,
MachineInstr MI
[inline]
 

removeVirtualRegisterDead - Remove the specified virtual register from the live variable information. Returns true if the variable was marked dead at the specified instruction, false otherwise.

Definition at line 197 of file LiveVariables.h.

References getVarInfo(), killed_begin(), and killed_end().

bool llvm::LiveVariables::removeVirtualRegisterKilled unsigned  reg,
MachineBasicBlock MBB,
MachineInstr MI
[inline]
 

removeVirtualRegisterKilled - Remove the specified virtual register from the live variable information. Returns true if the variable was marked as killed by the specified instruction, false otherwise.

Definition at line 161 of file LiveVariables.h.

References getVarInfo(), killed_begin(), and killed_end().

void llvm::LiveVariables::removeVirtualRegistersDead killed_iterator  B,
killed_iterator  E
[inline]
 

removeVirtualRegistersDead - Remove all of the specified dead registers from the live variable information.

Definition at line 214 of file LiveVariables.h.

References getVarInfo(), I, and llvm::LiveVariables::VarInfo::removeKill().

void llvm::LiveVariables::removeVirtualRegistersKilled killed_iterator  B,
killed_iterator  E
[inline]
 

removeVirtualRegistersKilled - Remove all of the specified killed registers from the live variable information.

Definition at line 177 of file LiveVariables.h.

References getVarInfo(), I, and llvm::LiveVariables::VarInfo::removeKill().

bool LiveVariables::runOnMachineFunction MachineFunction MF  )  [virtual]
 

Get some space for a respectable number of registers...

Implements llvm::MachineFunctionPass.

Definition at line 148 of file LiveVariables.cpp.

References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::LiveVariables::VarInfo::DefInst, llvm::df_ext_begin(), llvm::df_ext_end(), E, llvm::MachineFunction::end(), llvm::MachineBasicBlock::end(), llvm::MRegisterInfo::FirstVirtualRegister, llvm::TargetInstrInfo::get(), llvm::MRegisterInfo::getAllocatableSet(), llvm::TargetMachine::getInstrInfo(), llvm::MachineOperand::getMachineBasicBlock(), llvm::MachineBasicBlock::getNumber(), llvm::MachineInstr::getNumOperands(), llvm::MRegisterInfo::getNumRegs(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getTarget(), getVarInfo(), llvm::MachineOperand::getVRegValueOrNull(), HandleVirtRegUse(), I, llvm::TargetInstrDescriptor::ImplicitDefs, llvm::TargetInstrDescriptor::ImplicitUses, llvm::MachineOperand::isDef(), llvm::MRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isRegister(), llvm::MachineOperand::isUse(), llvm::MRegisterInfo::isVirtualRegister(), llvm::LiveVariables::VarInfo::Kills, MarkVirtRegAliveInBlock(), llvm::TargetInstrInfo::PHI, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().


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