LLVM 22.0.0git
llvm::VirtRegMap Class Reference

#include "llvm/CodeGen/VirtRegMap.h"

Public Member Functions

 VirtRegMap ()
 VirtRegMap (const VirtRegMap &)=delete
VirtRegMapoperator= (const VirtRegMap &)=delete
 VirtRegMap (VirtRegMap &&)=default
LLVM_ABI void init (MachineFunction &MF)
MachineFunctiongetMachineFunction () const
MachineRegisterInfogetRegInfo () const
const TargetRegisterInfogetTargetRegInfo () const
LLVM_ABI 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
LLVM_ABI void assignVirt2Phys (Register virtReg, MCRegister 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
LLVM_ABI bool hasPreferredPhys (Register VirtReg) const
 returns true if VirtReg is assigned to its preferred physreg.
LLVM_ABI 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
LLVM_ABI int assignVirt2StackSlot (Register virtReg)
 create a mapping for the specifed virtual register to the next available stack slot
LLVM_ABI void assignVirt2StackSlot (Register virtReg, int SS)
 create a mapping for the specified virtual register to the specified stack slot
LLVM_ABI void print (raw_ostream &OS, const Module *M=nullptr) const
LLVM_ABI void dump () const

Static Public Attributes

static constexpr int NO_STACK_SLOT = INT_MAX

Detailed Description

Definition at line 35 of file VirtRegMap.h.

Constructor & Destructor Documentation

◆ VirtRegMap() [1/3]

llvm::VirtRegMap::VirtRegMap ( )
inline

Definition at line 68 of file VirtRegMap.h.

References NO_STACK_SLOT.

Referenced by operator=(), VirtRegMap(), and VirtRegMap().

◆ VirtRegMap() [2/3]

llvm::VirtRegMap::VirtRegMap ( const VirtRegMap & )
delete

References VirtRegMap().

◆ VirtRegMap() [3/3]

llvm::VirtRegMap::VirtRegMap ( VirtRegMap && )
default

References VirtRegMap().

Member Function Documentation

◆ assignVirt2Phys()

void VirtRegMap::assignVirt2Phys ( Register virtReg,
MCRegister physReg )

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

Definition at line 86 of file VirtRegMap.cpp.

References assert(), getRegInfo(), llvm::MCRegister::isPhysical(), and llvm::Register::isVirtual().

◆ assignVirt2Shape()

void llvm::VirtRegMap::assignVirt2Shape ( Register virtReg,
ShapeT shape )
inline

Definition at line 111 of file VirtRegMap.h.

Referenced by getTileShape().

◆ assignVirt2StackSlot() [1/2]

int VirtRegMap::assignVirt2StackSlot ( Register virtReg)

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

Definition at line 128 of file VirtRegMap.cpp.

References assert(), llvm::Register::isVirtual(), and NO_STACK_SLOT.

◆ assignVirt2StackSlot() [2/2]

void VirtRegMap::assignVirt2StackSlot ( Register virtReg,
int SS )

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

Definition at line 136 of file VirtRegMap.cpp.

References assert(), llvm::Register::isVirtual(), and NO_STACK_SLOT.

◆ clearAllVirt()

void llvm::VirtRegMap::clearAllVirt ( )
inline

clears all virtual to physical register mappings

Definition at line 125 of file VirtRegMap.h.

References grow().

◆ clearVirt()

void llvm::VirtRegMap::clearVirt ( Register virtReg)
inline

clears the specified virtual register's, physical register mapping

Definition at line 117 of file VirtRegMap.h.

References assert(), and llvm::Register::isVirtual().

◆ dump()

LLVM_DUMP_METHOD void VirtRegMap::dump ( ) const

Definition at line 168 of file VirtRegMap.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, and print().

◆ getMachineFunction()

MachineFunction & llvm::VirtRegMap::getMachineFunction ( ) const
inline

Definition at line 75 of file VirtRegMap.h.

References assert().

Referenced by llvm::AllocationOrder::create(), and llvm::RegAllocBase::init().

◆ getOriginal()

Register llvm::VirtRegMap::getOriginal ( Register VirtReg) const
inline

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 155 of file VirtRegMap.h.

References getPreSplitReg().

◆ getPhys()

◆ getPreSplitReg()

Register llvm::VirtRegMap::getPreSplitReg ( Register virtReg) const
inline

returns the live interval virtReg is split from.

Definition at line 147 of file VirtRegMap.h.

Referenced by getOriginal().

◆ getRegInfo()

MachineRegisterInfo & llvm::VirtRegMap::getRegInfo ( ) const
inline

Definition at line 80 of file VirtRegMap.h.

Referenced by assignVirt2Phys(), and llvm::RegAllocBase::init().

◆ getShape()

ShapeT llvm::VirtRegMap::getShape ( Register virtReg) const
inline

Definition at line 106 of file VirtRegMap.h.

References assert(), and llvm::Register::isVirtual().

Referenced by collectVirtRegShapes(), getTileShape(), and setIsSplitFromReg().

◆ getStackSlot()

int llvm::VirtRegMap::getStackSlot ( Register virtReg) const
inline

returns the stack slot mapped to the specified virtual register

Definition at line 172 of file VirtRegMap.h.

References assert(), and llvm::Register::isVirtual().

Referenced by llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), and isAssignedReg().

◆ getTargetRegInfo()

const TargetRegisterInfo & llvm::VirtRegMap::getTargetRegInfo ( ) const
inline

Definition at line 81 of file VirtRegMap.h.

Referenced by llvm::AllocationOrder::create(), and llvm::RegAllocBase::init().

◆ grow()

void VirtRegMap::grow ( )

Definition at line 79 of file VirtRegMap.cpp.

Referenced by clearAllVirt().

◆ hasKnownPreference()

bool VirtRegMap::hasKnownPreference ( Register VirtReg) const

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 119 of file VirtRegMap.cpp.

References hasPhys().

◆ hasPhys()

◆ hasPreferredPhys()

bool VirtRegMap::hasPreferredPhys ( Register VirtReg) const

returns true if VirtReg is assigned to its preferred physreg.

Definition at line 110 of file VirtRegMap.cpp.

References getPhys(), llvm::Register::isValid(), llvm::Register::isVirtual(), and Register.

◆ hasShape()

bool llvm::VirtRegMap::hasShape ( Register virtReg) const
inline

Definition at line 102 of file VirtRegMap.h.

Referenced by getTileShape(), and setIsSplitFromReg().

◆ init()

LLVM_ABI void llvm::VirtRegMap::init ( MachineFunction & MF)

◆ isAssignedReg()

bool llvm::VirtRegMap::isAssignedReg ( Register virtReg) const
inline

returns true if the specified virtual register is not mapped to a stack slot or rematerialized.

Definition at line 162 of file VirtRegMap.h.

References getStackSlot(), and NO_STACK_SLOT.

Referenced by llvm::LiveDebugVariables::LDVImpl::emitDebugValues().

◆ isShapeMapEmpty()

bool llvm::VirtRegMap::isShapeMapEmpty ( ) const
inline

Definition at line 100 of file VirtRegMap.h.

◆ operator=()

VirtRegMap & llvm::VirtRegMap::operator= ( const VirtRegMap & )
delete

References VirtRegMap().

◆ print()

void VirtRegMap::print ( raw_ostream & OS,
const Module * M = nullptr ) const

Definition at line 146 of file VirtRegMap.cpp.

References llvm::Register::index2VirtReg(), NO_STACK_SLOT, and llvm::printReg().

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

◆ setIsSplitFromReg()

void llvm::VirtRegMap::setIsSplitFromReg ( Register virtReg,
Register SReg )
inline

records virtReg is a split live interval from SReg.

Definition at line 139 of file VirtRegMap.h.

References getShape(), and hasShape().

Member Data Documentation

◆ NO_STACK_SLOT

int llvm::VirtRegMap::NO_STACK_SLOT = INT_MAX
staticconstexpr

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