LLVM
8.0.1
|
#include "llvm/CodeGen/VirtRegMap.h"
Public Types | |
enum | { NO_PHYS_REG = 0, NO_STACK_SLOT = (1L << 30)-1, MAX_STACK_SLOT = (1L << 18)-1 } |
Public Member Functions | |
VirtRegMap () | |
VirtRegMap (const VirtRegMap &)=delete | |
VirtRegMap & | operator= (const VirtRegMap &)=delete |
bool | runOnMachineFunction (MachineFunction &MF) override |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis. More... | |
void | getAnalysisUsage (AnalysisUsage &AU) const override |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. More... | |
MachineFunction & | getMachineFunction () const |
MachineRegisterInfo & | getRegInfo () const |
const TargetRegisterInfo & | getTargetRegInfo () const |
void | grow () |
bool | hasPhys (unsigned virtReg) const |
returns true if the specified virtual register is mapped to a physical register More... | |
unsigned | getPhys (unsigned virtReg) const |
returns the physical register mapped to the specified virtual register More... | |
void | assignVirt2Phys (unsigned virtReg, MCPhysReg physReg) |
creates a mapping for the specified virtual register to the specified physical register More... | |
void | clearVirt (unsigned virtReg) |
clears the specified virtual register's, physical register mapping More... | |
void | clearAllVirt () |
clears all virtual to physical register mappings More... | |
bool | hasPreferredPhys (unsigned VirtReg) |
returns true if VirtReg is assigned to its preferred physreg. More... | |
bool | hasKnownPreference (unsigned VirtReg) |
returns true if VirtReg has a known preferred register. More... | |
void | setIsSplitFromReg (unsigned virtReg, unsigned SReg) |
records virtReg is a split live interval from SReg. More... | |
unsigned | getPreSplitReg (unsigned virtReg) const |
returns the live interval virtReg is split from. More... | |
unsigned | getOriginal (unsigned VirtReg) const |
getOriginal - Return the original virtual register that VirtReg descends from through splitting. More... | |
bool | isAssignedReg (unsigned virtReg) const |
returns true if the specified virtual register is not mapped to a stack slot or rematerialized. More... | |
int | getStackSlot (unsigned virtReg) const |
returns the stack slot mapped to the specified virtual register More... | |
int | assignVirt2StackSlot (unsigned virtReg) |
create a mapping for the specifed virtual register to the next available stack slot More... | |
void | assignVirt2StackSlot (unsigned virtReg, int SS) |
create a mapping for the specified virtual register to the specified stack slot More... | |
void | print (raw_ostream &OS, const Module *M=nullptr) const override |
print - Print out the internal state of the pass. More... | |
void | dump () const |
Public Member Functions inherited from llvm::MachineFunctionPass | |
bool | doInitialization (Module &) override |
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. More... | |
Public Member Functions inherited from llvm::FunctionPass | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &OS, const std::string &Banner) const override |
createPrinterPass - Get a function printer pass. More... | |
void | assignPassManager (PMStack &PMS, PassManagerType T) override |
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager. More... | |
PassManagerType | getPotentialPassManagerType () const override |
Return what kind of Pass Manager can manage this pass. More... | |
Public Member Functions inherited from llvm::Pass | |
Pass (PassKind K, char &pid) | |
Pass (const Pass &)=delete | |
Pass & | operator= (const Pass &)=delete |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual StringRef | getPassName () const |
getPassName - Return a nice clean name for a pass. More... | |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doFinalization (Module &) |
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More... | |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void | releaseMemory () |
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. More... | |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More... | |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More... | |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More... | |
bool | mustPreserveAnalysisID (char &AID) const |
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::Pass | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Protected Member Functions inherited from llvm::MachineFunctionPass | |
MachineFunctionPass (char &ID) | |
virtual MachineFunctionProperties | getRequiredProperties () const |
virtual MachineFunctionProperties | getSetProperties () const |
virtual MachineFunctionProperties | getClearedProperties () const |
Protected Member Functions inherited from llvm::FunctionPass | |
bool | skipFunction (const Function &F) const |
Optional passes call this function to check whether the pass should be skipped. More... | |
Definition at line 34 of file VirtRegMap.h.
anonymous enum |
Enumerator | |
---|---|
NO_PHYS_REG | |
NO_STACK_SLOT | |
MAX_STACK_SLOT |
Definition at line 36 of file VirtRegMap.h.
|
inline |
Definition at line 71 of file VirtRegMap.h.
References operator=(), and runOnMachineFunction().
|
delete |
creates a mapping for the specified virtual register to the specified physical register
Definition at line 84 of file VirtRegMap.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::MachineFrameInfo::CreateSpillStackObject(), llvm::MachineFunction::getFrameInfo(), getRegInfo(), llvm::TargetRegisterInfo::getSpillAlignment(), llvm::TargetRegisterInfo::getSpillSize(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::TargetRegisterInfo::isVirtualRegister(), NO_PHYS_REG, and Size.
Referenced by llvm::RegAllocBase::allocatePhysRegs(), llvm::LiveRegMatrix::assign(), getPhys(), and isACalleeSavedRegister().
int VirtRegMap::assignVirt2StackSlot | ( | unsigned | virtReg | ) |
create a mapping for the specifed virtual register to the next available stack slot
Definition at line 121 of file VirtRegMap.cpp.
References assert(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetRegisterInfo::isVirtualRegister(), and NO_STACK_SLOT.
Referenced by getStackSlot().
void VirtRegMap::assignVirt2StackSlot | ( | unsigned | virtReg, |
int | SS | ||
) |
create a mapping for the specified virtual register to the specified stack slot
Definition at line 129 of file VirtRegMap.cpp.
References assert(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::TargetRegisterInfo::isVirtualRegister(), and NO_STACK_SLOT.
|
inline |
clears all virtual to physical register mappings
Definition at line 120 of file VirtRegMap.h.
References llvm::IndexedMap< T, ToIndexT >::clear(), grow(), hasKnownPreference(), and hasPreferredPhys().
Referenced by isACalleeSavedRegister().
|
inline |
clears the specified virtual register's, physical register mapping
Definition at line 112 of file VirtRegMap.h.
References assert(), llvm::TargetRegisterInfo::isVirtualRegister(), and NO_PHYS_REG.
Referenced by llvm::LiveRegMatrix::unassign().
LLVM_DUMP_METHOD void VirtRegMap::dump | ( | ) | const |
Definition at line 161 of file VirtRegMap.cpp.
References llvm::dbgs(), getAnalysisUsage(), llvm::MachineFunctionPass::getSetProperties(), ID, llvm::MachineFunctionPass::MachineFunctionPass(), MI, MRI, llvm::MachineFunctionProperties::NoVRegs, print(), runOnMachineFunction(), llvm::MachineFunctionProperties::set(), TII, and TRI.
Referenced by getStackSlot().
|
inlineoverridevirtual |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Reimplemented from llvm::MachineFunctionPass.
Definition at line 78 of file VirtRegMap.h.
References llvm::MachineFunctionPass::getAnalysisUsage(), and llvm::AnalysisUsage::setPreservesAll().
Referenced by dump().
|
inline |
Definition at line 83 of file VirtRegMap.h.
References assert().
Referenced by llvm::AllocationOrder::AllocationOrder(), findNextInsertLocation(), llvm::RegAllocBase::init(), and llvm::SplitEditor::reset().
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 147 of file VirtRegMap.h.
References getPreSplitReg().
Referenced by llvm::SplitEditor::dump(), llvm::SplitAnalysis::isOriginalEndpoint(), and isRematerializable().
returns the physical register mapped to the specified virtual register
Definition at line 101 of file VirtRegMap.h.
References assert(), assignVirt2Phys(), and llvm::TargetRegisterInfo::isVirtualRegister().
Referenced by llvm::LiveIntervals::addKillFlags(), getRC32(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), hasPhys(), hasPreferredPhys(), llvm::LiveDebugVariables::splitRegister(), and llvm::LiveRegMatrix::unassign().
returns the live interval virtReg is split from.
Definition at line 139 of file VirtRegMap.h.
Referenced by getOriginal().
|
inline |
Definition at line 88 of file VirtRegMap.h.
Referenced by assignVirt2Phys(), llvm::RegAllocBase::init(), and isACalleeSavedRegister().
|
inline |
returns the stack slot mapped to the specified virtual register
Definition at line 164 of file VirtRegMap.h.
References assert(), assignVirt2StackSlot(), dump(), llvm::TargetRegisterInfo::isVirtualRegister(), and print().
Referenced by isAssignedReg(), and llvm::LiveDebugVariables::splitRegister().
|
inline |
Definition at line 89 of file VirtRegMap.h.
References grow().
Referenced by llvm::AllocationOrder::AllocationOrder(), and llvm::RegAllocBase::init().
void VirtRegMap::grow | ( | ) |
Definition at line 77 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getNumVirtRegs(), and llvm::MachineFunction::getRegInfo().
Referenced by clearAllVirt(), and getTargetRegInfo().
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 112 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getRegAllocationHint(), hasPhys(), llvm::TargetRegisterInfo::isPhysicalRegister(), and llvm::TargetRegisterInfo::isVirtualRegister().
Referenced by clearAllVirt().
returns true if the specified virtual register is mapped to a physical register
Definition at line 95 of file VirtRegMap.h.
References getPhys(), and NO_PHYS_REG.
Referenced by llvm::RegAllocBase::allocatePhysRegs(), llvm::LiveRegMatrix::assign(), getRC32(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), and hasKnownPreference().
returns true if VirtReg is assigned to its preferred physreg.
Definition at line 103 of file VirtRegMap.cpp.
References getPhys(), llvm::MachineRegisterInfo::getSimpleHint(), and llvm::TargetRegisterInfo::isVirtualRegister().
Referenced by clearAllVirt().
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
Definition at line 154 of file VirtRegMap.h.
References getStackSlot(), NO_PHYS_REG, and NO_STACK_SLOT.
Referenced by llvm::LiveDebugVariables::splitRegister().
|
delete |
Referenced by VirtRegMap().
|
overridevirtual |
print - Print out the internal state of the pass.
This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.
Reimplemented from llvm::Pass.
Definition at line 139 of file VirtRegMap.cpp.
References llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClassName(), llvm::TargetRegisterInfo::index2VirtReg(), NO_PHYS_REG, NO_STACK_SLOT, llvm::printReg(), and Reg.
Referenced by dump(), getStackSlot(), and llvm::operator<<().
|
overridevirtual |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Implements llvm::MachineFunctionPass.
Definition at line 63 of file VirtRegMap.cpp.
Referenced by dump(), and VirtRegMap().
records virtReg is a split live interval from SReg.
Definition at line 134 of file VirtRegMap.h.
|
static |
Definition at line 69 of file VirtRegMap.h.
Referenced by dump().