LLVM API Documentation
#include <VirtRegMap.h>
Collaboration diagram for llvm::VirtRegMap:
Public Types | |
typedef std::multimap< MachineInstr *, std::pair< unsigned, ModRef > > | MI2VirtMapTy |
isRef = 1 | |
isMod = 2 | |
isModRef = 3 | |
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 |
Definition at line 27 of file VirtRegMap.h.
typedef std::multimap<MachineInstr*, std::pair<unsigned, ModRef> > llvm::VirtRegMap::MI2VirtMapTy |
Definition at line 31 of file VirtRegMap.h.
llvm::VirtRegMap::VirtRegMap | ( | MachineFunction & | mf | ) | [inline] |
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 76 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 64 of file VirtRegMap.cpp.
References llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineFunction::getFrameInfo(), llvm::SSARegMap::getRegClass(), llvm::MachineFunction::getSSARegMap(), llvm::MRegisterInfo::isVirtualRegister(), NumSpills, and RC.
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 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 |
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.
References MI.
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 59 of file VirtRegMap.cpp.
References llvm::SSARegMap::getLastVirtReg(), and llvm::MachineFunction::getSSARegMap().
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 105 of file VirtRegMap.cpp.
References llvm::MRegisterInfo::FirstVirtualRegister, llvm::SSARegMap::getLastVirtReg(), llvm::MRegisterInfo::getName(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getSSARegMap(), llvm::MachineFunction::getTarget(), and MRI.
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 83 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().