LLVM 20.0.0git
|
#include "llvm/CodeGen/VirtRegMap.h"
Public Member Functions | |
VirtRegMap () | |
VirtRegMap (const VirtRegMap &)=delete | |
VirtRegMap & | operator= (const VirtRegMap &)=delete |
VirtRegMap (VirtRegMap &&)=default | |
void | init (MachineFunction &MF) |
MachineFunction & | getMachineFunction () const |
MachineRegisterInfo & | getRegInfo () const |
const TargetRegisterInfo & | getTargetRegInfo () const |
void | grow () |
bool | hasPhys (Register virtReg) const |
returns true if the specified virtual register is mapped to a physical register | |
MCRegister | getPhys (Register virtReg) const |
returns the physical register mapped to the specified virtual register | |
void | assignVirt2Phys (Register virtReg, MCPhysReg physReg) |
creates a mapping for the specified virtual register to the specified physical register | |
bool | isShapeMapEmpty () const |
bool | hasShape (Register virtReg) const |
ShapeT | getShape (Register virtReg) const |
void | assignVirt2Shape (Register virtReg, ShapeT shape) |
void | clearVirt (Register virtReg) |
clears the specified virtual register's, physical register mapping | |
void | clearAllVirt () |
clears all virtual to physical register mappings | |
bool | hasPreferredPhys (Register VirtReg) const |
returns true if VirtReg is assigned to its preferred physreg. | |
bool | hasKnownPreference (Register VirtReg) const |
returns true if VirtReg has a known preferred register. | |
void | setIsSplitFromReg (Register virtReg, Register SReg) |
records virtReg is a split live interval from SReg. | |
Register | getPreSplitReg (Register virtReg) const |
returns the live interval virtReg is split from. | |
Register | getOriginal (Register VirtReg) const |
getOriginal - Return the original virtual register that VirtReg descends from through splitting. | |
bool | isAssignedReg (Register virtReg) const |
returns true if the specified virtual register is not mapped to a stack slot or rematerialized. | |
int | getStackSlot (Register virtReg) const |
returns the stack slot mapped to the specified virtual register | |
int | assignVirt2StackSlot (Register virtReg) |
create a mapping for the specifed virtual register to the next available stack slot | |
void | assignVirt2StackSlot (Register virtReg, int SS) |
create a mapping for the specified virtual register to the specified stack slot | |
void | print (raw_ostream &OS, const Module *M=nullptr) const |
void | dump () const |
Static Public Attributes | |
static constexpr int | NO_STACK_SLOT = INT_MAX |
Definition at line 34 of file VirtRegMap.h.
|
inline |
Definition at line 67 of file VirtRegMap.h.
|
delete |
|
default |
creates a mapping for the specified virtual register to the specified physical register
Definition at line 86 of file VirtRegMap.cpp.
References assert(), llvm::MachineFunctionProperties::FailedRegAlloc, llvm::MachineFunction::getProperties(), getRegInfo(), llvm::MachineFunctionProperties::hasProperty(), llvm::Register::isPhysicalRegister(), and llvm::Register::isVirtual().
Referenced by llvm::RegAllocBase::allocatePhysRegs(), and llvm::LiveRegMatrix::assign().
Definition at line 110 of file VirtRegMap.h.
Referenced by getTileShape().
int VirtRegMap::assignVirt2StackSlot | ( | Register | virtReg | ) |
create a mapping for the specifed virtual register to the next available stack slot
Definition at line 130 of file VirtRegMap.cpp.
References assert(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::Register::isVirtual(), and NO_STACK_SLOT.
void VirtRegMap::assignVirt2StackSlot | ( | Register | virtReg, |
int | SS | ||
) |
create a mapping for the specified virtual register to the specified stack slot
Definition at line 138 of file VirtRegMap.cpp.
References assert(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::Register::isVirtual(), and NO_STACK_SLOT.
|
inline |
clears all virtual to physical register mappings
Definition at line 124 of file VirtRegMap.h.
References llvm::IndexedMap< T, ToIndexT >::clear(), and grow().
|
inline |
clears the specified virtual register's, physical register mapping
Definition at line 116 of file VirtRegMap.h.
References assert(), and llvm::Register::isVirtual().
Referenced by llvm::LiveRegMatrix::unassign().
LLVM_DUMP_METHOD void VirtRegMap::dump | ( | ) | const |
Definition at line 170 of file VirtRegMap.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 74 of file VirtRegMap.h.
References assert().
Referenced by llvm::AllocationOrder::create(), llvm::SplitEditor::finish(), llvm::RegAllocBase::getErrorAssignment(), llvm::RegAllocBase::init(), llvm::SplitEditor::reset(), and llvm::SplitEditor::splitLiveThroughBlock().
getOriginal - Return the original virtual register that VirtReg descends from through splitting.
A register that was not created by splitting is its own original. This operation is idempotent.
Definition at line 154 of file VirtRegMap.h.
References getPreSplitReg().
Referenced by llvm::LiveRangeEdit::createFrom(), llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::SplitEditor::finish(), llvm::SplitAnalysis::isOriginalEndpoint(), llvm::VirtRegAuxInfo::isRematerializable(), and llvm::VirtRegAuxInfo::weightCalcHelper().
|
inline |
returns the physical register mapped to the specified virtual register
Definition at line 90 of file VirtRegMap.h.
References assert(), and llvm::Register::isVirtual().
Referenced by llvm::LiveIntervals::addKillFlags(), assignedRegPartiallyOverlaps(), collectVirtRegShapes(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), getRC32(), llvm::AArch64RegisterInfo::getRegAllocationHints(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::PPCRegisterInfo::getRegAllocationHints(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::SystemZRegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), hasPhys(), hasPreferredPhys(), and llvm::LiveRegMatrix::unassign().
returns the live interval virtReg is split from.
Definition at line 146 of file VirtRegMap.h.
Referenced by getOriginal().
|
inline |
Definition at line 79 of file VirtRegMap.h.
References MRI.
Referenced by assignVirt2Phys(), and llvm::RegAllocBase::init().
Definition at line 105 of file VirtRegMap.h.
References assert(), llvm::Register::isVirtual(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Referenced by collectVirtRegShapes(), getTileShape(), and setIsSplitFromReg().
|
inline |
returns the stack slot mapped to the specified virtual register
Definition at line 171 of file VirtRegMap.h.
References assert(), and llvm::Register::isVirtual().
Referenced by llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), and isAssignedReg().
|
inline |
Definition at line 80 of file VirtRegMap.h.
References TRI.
Referenced by llvm::AllocationOrder::create(), and llvm::RegAllocBase::init().
void VirtRegMap::grow | ( | ) |
Definition at line 79 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getNumVirtRegs(), and llvm::MachineFunction::getRegInfo().
Referenced by clearAllVirt().
returns true if VirtReg has a known preferred register.
This returns false if VirtReg has a preference that is a virtual register that hasn't been assigned yet.
Definition at line 121 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getRegAllocationHint(), and hasPhys().
returns true if the specified virtual register is mapped to a physical register
Definition at line 86 of file VirtRegMap.h.
References getPhys(), and llvm::MCRegister::isValid().
Referenced by llvm::RegAllocBase::allocatePhysRegs(), llvm::LiveRegMatrix::assign(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), llvm::RegAllocBase::enqueue(), getRC32(), llvm::AArch64RegisterInfo::getRegAllocationHints(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::PPCRegisterInfo::getRegAllocationHints(), and hasKnownPreference().
returns true if VirtReg is assigned to its preferred physreg.
Definition at line 112 of file VirtRegMap.cpp.
References getPhys(), llvm::MachineRegisterInfo::getSimpleHint(), llvm::Register::isValid(), and llvm::Register::isVirtual().
Definition at line 101 of file VirtRegMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains().
Referenced by getTileShape(), and setIsSplitFromReg().
void llvm::VirtRegMap::init | ( | MachineFunction & | MF | ) |
Referenced by llvm::VirtRegMapAnalysis::run(), and llvm::VirtRegMapWrapperLegacy::runOnMachineFunction().
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
Definition at line 161 of file VirtRegMap.h.
References getStackSlot(), and NO_STACK_SLOT.
Referenced by llvm::LiveDebugVariables::LDVImpl::emitDebugValues().
|
inline |
Definition at line 99 of file VirtRegMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty().
|
delete |
void VirtRegMap::print | ( | raw_ostream & | OS, |
const Module * | M = nullptr |
||
) | const |
Definition at line 148 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClassName(), llvm::Register::index2VirtReg(), NO_STACK_SLOT, OS, and llvm::printReg().
Referenced by dump(), llvm::operator<<(), and llvm::VirtRegMapWrapperLegacy::print().
records virtReg is a split live interval from SReg.
Definition at line 138 of file VirtRegMap.h.
References getShape(), and hasShape().
Referenced by llvm::LiveRangeEdit::createFrom(), llvm::LiveRangeEdit::eliminateDeadDefs(), and llvm::SplitEditor::finish().
|
staticconstexpr |
Definition at line 65 of file VirtRegMap.h.
Referenced by assignVirt2StackSlot(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), isAssignedReg(), and print().