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

#include <VirtRegMap.h>

Collaboration diagram for llvm::VirtRegMap:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::multimap< MachineInstr *,
std::pair< unsigned, ModRef > > 
MI2VirtMapTy
enum  ModRef { isRef = 1, isMod = 2, isModRef = 3 }

Public Member Functions

 VirtRegMap (MachineFunction &mf)
void grow ()
bool hasPhys (unsigned virtReg) const
 returns true if the specified virtual register is mapped to a physical register
unsigned getPhys (unsigned virtReg) const
 returns the physical register mapped to the specified virtual register
void assignVirt2Phys (unsigned virtReg, unsigned physReg)
 creates a mapping for the specified virtual register to the specified physical register
void clearVirt (unsigned virtReg)
 clears the specified virtual register's, physical register mapping
void clearAllVirt ()
 clears all virtual to physical register mappings
bool hasStackSlot (unsigned virtReg) const
 returns true is the specified virtual register is mapped to a stack slot
int getStackSlot (unsigned virtReg) const
 returns the stack slot mapped to the specified virtual register
int assignVirt2StackSlot (unsigned virtReg)
 create a mapping for the specifed virtual register to the next available stack slot
void assignVirt2StackSlot (unsigned virtReg, int frameIndex)
 create a mapping for the specified virtual register to the specified stack slot
void virtFolded (unsigned VirtReg, MachineInstr *OldMI, unsigned OpNum, MachineInstr *NewMI)
 Updates information about the specified virtual register's value folded into newMI machine instruction. The OpNum argument indicates the operand number of OldMI that is folded.
std::pair< MI2VirtMapTy::const_iterator,
MI2VirtMapTy::const_iterator > 
getFoldedVirts (MachineInstr *MI) const
 returns the virtual registers' values folded in memory operands of this instruction
void print (std::ostream &OS) const
void dump () const

Detailed Description

Definition at line 27 of file VirtRegMap.h.


Member Typedef Documentation

typedef std::multimap<MachineInstr*, std::pair<unsigned, ModRef> > llvm::VirtRegMap::MI2VirtMapTy
 

Definition at line 31 of file VirtRegMap.h.


Member Enumeration Documentation

enum llvm::VirtRegMap::ModRef
 

Enumerator:
isRef 
isMod 
isModRef 

Definition at line 29 of file VirtRegMap.h.


Constructor & Destructor Documentation

llvm::VirtRegMap::VirtRegMap MachineFunction mf  )  [inline]
 

Definition at line 61 of file VirtRegMap.h.

References grow().


Member Function Documentation

void llvm::VirtRegMap::assignVirt2Phys unsigned  virtReg,
unsigned  physReg
[inline]
 

creates a mapping for the specified virtual register to the specified physical register

Definition at line 83 of file VirtRegMap.h.

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

void VirtRegMap::assignVirt2StackSlot unsigned  virtReg,
int  frameIndex
 

create a mapping for the specified virtual register to the specified stack slot

Definition at line 74 of file VirtRegMap.cpp.

References llvm::MRegisterInfo::isVirtualRegister().

int VirtRegMap::assignVirt2StackSlot unsigned  virtReg  ) 
 

create a mapping for the specifed virtual register to the next available stack slot

Definition at line 62 of file VirtRegMap.cpp.

References llvm::MachineFrameInfo::CreateStackObject(), llvm::TargetRegisterClass::getAlignment(), llvm::MachineFunction::getFrameInfo(), llvm::SSARegMap::getRegClass(), llvm::TargetRegisterClass::getSize(), llvm::MachineFunction::getSSARegMap(), llvm::MRegisterInfo::isVirtualRegister(), and NumSpills.

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

void llvm::VirtRegMap::clearAllVirt  )  [inline]
 

clears all virtual to physical register mappings

Definition at line 102 of file VirtRegMap.h.

References llvm::DenseMap< T, ToIndexT >::clear(), and grow().

void llvm::VirtRegMap::clearVirt unsigned  virtReg  )  [inline]
 

clears the specified virtual register's, physical register mapping

Definition at line 94 of file VirtRegMap.h.

References llvm::MRegisterInfo::isVirtualRegister().

void VirtRegMap::dump  )  const
 

Definition at line 121 of file VirtRegMap.cpp.

References print().

std::pair<MI2VirtMapTy::const_iterator, MI2VirtMapTy::const_iterator> llvm::VirtRegMap::getFoldedVirts MachineInstr MI  )  const [inline]
 

returns the virtual registers' values folded in memory operands of this instruction

Definition at line 136 of file VirtRegMap.h.

unsigned llvm::VirtRegMap::getPhys unsigned  virtReg  )  const [inline]
 

returns the physical register mapped to the specified virtual register

Definition at line 76 of file VirtRegMap.h.

References llvm::MRegisterInfo::isVirtualRegister().

Referenced by hasPhys().

int llvm::VirtRegMap::getStackSlot unsigned  virtReg  )  const [inline]
 

returns the stack slot mapped to the specified virtual register

Definition at line 115 of file VirtRegMap.h.

References llvm::MRegisterInfo::isVirtualRegister().

Referenced by hasStackSlot().

void VirtRegMap::grow  ) 
 

Definition at line 57 of file VirtRegMap.cpp.

References llvm::SSARegMap::getLastVirtReg(), llvm::MachineFunction::getSSARegMap(), and llvm::DenseMap< T, ToIndexT >::grow().

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), clearAllVirt(), and VirtRegMap().

bool llvm::VirtRegMap::hasPhys unsigned  virtReg  )  const [inline]
 

returns true if the specified virtual register is mapped to a physical register

Definition at line 70 of file VirtRegMap.h.

References getPhys().

bool llvm::VirtRegMap::hasStackSlot unsigned  virtReg  )  const [inline]
 

returns true is the specified virtual register is mapped to a stack slot

Definition at line 109 of file VirtRegMap.h.

References getStackSlot().

void VirtRegMap::print std::ostream &  OS  )  const
 

Definition at line 103 of file VirtRegMap.cpp.

References llvm::MRegisterInfo::FirstVirtualRegister, llvm::SSARegMap::getLastVirtReg(), llvm::MRegisterInfo::getName(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getSSARegMap(), and llvm::MachineFunction::getTarget().

Referenced by dump(), and llvm::operator<<().

void VirtRegMap::virtFolded unsigned  VirtReg,
MachineInstr OldMI,
unsigned  OpNum,
MachineInstr NewMI
 

Updates information about the specified virtual register's value folded into newMI machine instruction. The OpNum argument indicates the operand number of OldMI that is folded.

Definition at line 81 of file VirtRegMap.cpp.

References E, llvm::MachineInstr::getOperand(), I, llvm::MachineOperand::isDef(), isMod, isModRef, isRef, and llvm::MachineOperand::isUse().

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


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