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

 LiveVariables ()
virtual bool runOnMachineFunction (MachineFunction &MF)
bool RegisterDefIsDead (MachineInstr *MI, unsigned Reg) const
void replaceKillInstruction (unsigned Reg, MachineInstr *OldMI, MachineInstr *NewMI)
void addVirtualRegisterKilled (unsigned IncomingReg, MachineInstr *MI, bool AddIfNotFound=false)
bool removeVirtualRegisterKilled (unsigned reg, MachineInstr *MI)
void removeVirtualRegistersKilled (MachineInstr *MI)
void addVirtualRegisterDead (unsigned IncomingReg, MachineInstr *MI, bool AddIfNotFound=false)
bool removeVirtualRegisterDead (unsigned reg, MachineInstr *MI)
void getAnalysisUsage (AnalysisUsage &AU) const
virtual void releaseMemory ()
VarInfogetVarInfo (unsigned RegIdx)
 getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.
void MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *BB)
void MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *BB, std::vector< MachineBasicBlock * > &WorkList)
void HandleVirtRegUse (unsigned reg, MachineBasicBlock *MBB, MachineInstr *MI)

Static Public Attributes

char ID = 0

Constructor & Destructor Documentation

llvm::LiveVariables::LiveVariables  )  [inline]
 

Definition at line 46 of file LiveVariables.h.


Member Function Documentation

void llvm::LiveVariables::addVirtualRegisterDead unsigned  IncomingReg,
MachineInstr MI,
bool  AddIfNotFound = false
[inline]
 

addVirtualRegisterDead - Add information about the fact that the specified register is dead after being used by the specified instruction. If AddIfNotFound is true, add a implicit operand if it's not found.

Definition at line 224 of file LiveVariables.h.

References llvm::MachineInstr::addRegisterDead().

Referenced by llvm::ARMInstrInfo::convertToThreeAddress(), and TwoAddressInstructionPass::runOnMachineFunction().

void llvm::LiveVariables::addVirtualRegisterKilled unsigned  IncomingReg,
MachineInstr MI,
bool  AddIfNotFound = false
[inline]
 

addVirtualRegisterKilled - Add information about the fact that the specified register is killed after being used by the specified instruction. If AddIfNotFound is true, add a implicit operand if it's not found.

Definition at line 189 of file LiveVariables.h.

References llvm::MachineInstr::addRegisterKilled().

Referenced by llvm::ARMInstrInfo::convertToThreeAddress(), and TwoAddressInstructionPass::runOnMachineFunction().

void LiveVariables::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 48 of file LiveVariables.cpp.

References llvm::AnalysisUsage::addRequiredID(), llvm::AnalysisUsage::setPreservesAll(), and llvm::UnreachableMachineBlockElimID.

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

getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.

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

Definition at line 71 of file LiveVariables.cpp.

References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::MachineFunction::getNumBlockIDs(), llvm::BitVector::resize(), and llvm::LiveVariables::VarInfo::UsedBlocks.

Referenced by llvm::X86InstrInfo::convertToThreeAddress(), llvm::ARMInstrInfo::convertToThreeAddress(), HandleVirtRegUse(), removeVirtualRegistersKilled(), replaceKillInstruction(), TwoAddressInstructionPass::runOnMachineFunction(), and runOnMachineFunction().

void LiveVariables::HandleVirtRegUse unsigned  reg,
MachineBasicBlock MBB,
MachineInstr MI
 

Definition at line 127 of file LiveVariables.cpp.

References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::MachineBasicBlock::getNumber(), llvm::MachineInstr::getParent(), getVarInfo(), llvm::MachineRegisterInfo::getVRegDef(), llvm::LiveVariables::VarInfo::Kills, MarkVirtRegAliveInBlock(), llvm::LiveVariables::VarInfo::NumUses, llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), and llvm::LiveVariables::VarInfo::UsedBlocks.

Referenced by runOnMachineFunction().

void LiveVariables::MarkVirtRegAliveInBlock VarInfo VRInfo,
MachineBasicBlock DefBlock,
MachineBasicBlock BB,
std::vector< MachineBasicBlock * > &  WorkList
 

Definition at line 87 of file LiveVariables.cpp.

References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::MachineBasicBlock::getNumber(), llvm::LiveVariables::VarInfo::Kills, llvm::MachineBasicBlock::pred_rbegin(), and llvm::MachineBasicBlock::pred_rend().

void LiveVariables::MarkVirtRegAliveInBlock VarInfo VRInfo,
MachineBasicBlock DefBlock,
MachineBasicBlock BB
 

Definition at line 114 of file LiveVariables.cpp.

Referenced by HandleVirtRegUse(), and runOnMachineFunction().

bool llvm::LiveVariables::RegisterDefIsDead MachineInstr MI,
unsigned  Reg
const
 

RegisterDefIsDead - Return true if the specified instruction defines the specified register, but that definition is dead.

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 253 of file LiveVariables.h.

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

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

Definition at line 234 of file LiveVariables.h.

References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isRegister(), and llvm::MachineOperand::setIsDead().

Referenced by TwoAddressInstructionPass::runOnMachineFunction().

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

removeVirtualRegisterKilled - Remove the specified kill of the 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 199 of file LiveVariables.h.

References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isRegister(), and llvm::MachineOperand::setIsKill().

Referenced by TwoAddressInstructionPass::runOnMachineFunction().

void LiveVariables::removeVirtualRegistersKilled MachineInstr MI  ) 
 

removeVirtualRegistersKilled - Remove all killed info for the specified instruction.

Definition at line 673 of file LiveVariables.cpp.

References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getVarInfo(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isRegister(), llvm::TargetRegisterInfo::isVirtualRegister(), Reg, llvm::LiveVariables::VarInfo::removeKill(), and llvm::MachineOperand::setIsKill().

void LiveVariables::replaceKillInstruction unsigned  Reg,
MachineInstr OldMI,
MachineInstr NewMI
 

replaceKillInstruction - Update register kill info by replacing a kill instruction with a new one.

Definition at line 665 of file LiveVariables.cpp.

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

Referenced by llvm::X86InstrInfo::convertToThreeAddress(), and TwoAddressInstructionPass::runOnMachineFunction().

bool LiveVariables::runOnMachineFunction MachineFunction mf  )  [virtual]
 

Get some space for a respectable number of registers.

Implements llvm::MachineFunctionPass.

Definition at line 494 of file LiveVariables.cpp.

References llvm::MachineInstr::addOperand(), llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::LiveVariables::VarInfo::AliveBlocks, llvm::MachineBasicBlock::back(), llvm::SmallVectorImpl< T >::begin(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::clear(), llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::df_ext_begin(), llvm::df_ext_end(), llvm::MachineBasicBlock::empty(), llvm::SmallVectorImpl< T >::empty(), llvm::MachineFunction::end(), llvm::SmallVectorImpl< T >::end(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::getDesc(), llvm::MachineBasicBlock::getNumber(), llvm::MachineFunction::getNumBlockIDs(), llvm::TargetRegisterInfo::getNumRegs(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetRegisterInfo::getReservedRegs(), llvm::MachineFunction::getTarget(), getVarInfo(), llvm::MachineRegisterInfo::getVRegDef(), HandleVirtRegUse(), llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::insert(), llvm::MachineOperand::isDef(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isRegister(), llvm::TargetInstrDesc::isReturn(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::LiveVariables::VarInfo::Kills, llvm::MachineBasicBlock::livein_begin(), llvm::MachineBasicBlock::livein_end(), llvm::MachineRegisterInfo::liveout_begin(), llvm::MachineRegisterInfo::liveout_end(), MarkVirtRegAliveInBlock(), llvm::BitVector::none(), llvm::SmallVectorImpl< T >::push_back(), llvm::MachineInstr::readsRegister(), llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorImpl< T >::size().


Member Data Documentation

char LiveVariables::ID = 0 [static]
 

Definition at line 44 of file LiveVariables.cpp.


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.