class VirtRegMap
Declaration
class VirtRegMap : public MachineFunctionPass { /* full declaration omitted */ };
Description
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:33
Inherits from: MachineFunctionPass
Member Variables
- private llvm::MachineRegisterInfo* MRI = nullptr
- private const llvm::TargetInstrInfo* TII = nullptr
- private const llvm::TargetRegisterInfo* TRI = nullptr
- private llvm::MachineFunction* MF = nullptr
- private IndexedMap<llvm::Register, llvm::VirtReg2IndexFunctor> Virt2PhysMap
- Virt2PhysMap - This is a virtual to physical register mapping. Each virtual register is required to have an entry in it; even spilled virtual registers (the register mapped to a spilled register is the temporary used to load it from the stack).
- private IndexedMap<int, llvm::VirtReg2IndexFunctor> Virt2StackSlotMap
- Virt2StackSlotMap - This is virtual register to stack slot mapping. Each spilled virtual register has an entry in it which corresponds to the stack slot this register is spilled at.
- private IndexedMap<unsigned int, llvm::VirtReg2IndexFunctor> Virt2SplitMap
- Virt2SplitMap - This is virtual register to splitted virtual register mapping.
- private DenseMap<unsigned int, llvm::ShapeT> Virt2ShapeMap
- Virt2ShapeMap - For X86 AMX register whose register is bound shape information.
- public static char ID
Method Overview
- public VirtRegMap()
- public VirtRegMap(const llvm::VirtRegMap &)
- public void assignVirt2Phys(llvm::Register virtReg, llvm::MCPhysReg physReg)
- public void assignVirt2Shape(llvm::Register virtReg, llvm::ShapeT shape)
- public void assignVirt2StackSlot(llvm::Register virtReg, int SS)
- public int assignVirt2StackSlot(llvm::Register virtReg)
- public void clearAllVirt()
- public void clearVirt(llvm::Register virtReg)
- private unsigned int createSpillSlot(const llvm::TargetRegisterClass * RC)
- public void dump() const
- public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
- public llvm::MachineFunction & getMachineFunction() const
- public llvm::Register getOriginal(llvm::Register VirtReg) const
- public llvm::MCRegister getPhys(llvm::Register virtReg) const
- public llvm::Register getPreSplitReg(llvm::Register virtReg) const
- public llvm::MachineRegisterInfo & getRegInfo() const
- public llvm::ShapeT getShape(llvm::Register virtReg) const
- public int getStackSlot(llvm::Register virtReg) const
- public const llvm::TargetRegisterInfo & getTargetRegInfo() const
- public void grow()
- public bool hasKnownPreference(llvm::Register VirtReg) const
- public bool hasPhys(llvm::Register virtReg) const
- public bool hasPreferredPhys(llvm::Register VirtReg) const
- public bool hasShape(llvm::Register virtReg) const
- public bool isAssignedReg(llvm::Register virtReg) const
- public bool isShapeMapEmpty() const
- public void print(llvm::raw_ostream & OS, const llvm::Module * M = nullptr) const
- public bool runOnMachineFunction(llvm::MachineFunction & MF)
- public void setIsSplitFromReg(llvm::Register virtReg, llvm::Register SReg)
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶VirtRegMap()
VirtRegMap()
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:74
¶VirtRegMap(const llvm::VirtRegMap&)
VirtRegMap(const llvm::VirtRegMap&)
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:77
Parameters
- const llvm::VirtRegMap&
¶void assignVirt2Phys(llvm::Register virtReg,
llvm::MCPhysReg physReg)
void assignVirt2Phys(llvm::Register virtReg,
llvm::MCPhysReg physReg)
Description
creates a mapping for the specified virtual register to the specified physical register
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:112
Parameters
- llvm::Register virtReg
- llvm::MCPhysReg physReg
¶void assignVirt2Shape(llvm::Register virtReg,
llvm::ShapeT shape)
void assignVirt2Shape(llvm::Register virtReg,
llvm::ShapeT shape)
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:125
Parameters
- llvm::Register virtReg
- llvm::ShapeT shape
¶void assignVirt2StackSlot(llvm::Register virtReg,
int SS)
void assignVirt2StackSlot(llvm::Register virtReg,
int SS)
Description
create a mapping for the specified virtual register to the specified stack slot
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:198
Parameters
- llvm::Register virtReg
- int SS
¶int assignVirt2StackSlot(llvm::Register virtReg)
int assignVirt2StackSlot(llvm::Register virtReg)
Description
create a mapping for the specifed virtual register to the next available stack slot
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:194
Parameters
- llvm::Register virtReg
¶void clearAllVirt()
void clearAllVirt()
Description
clears all virtual to physical register mappings
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:139
¶void clearVirt(llvm::Register virtReg)
void clearVirt(llvm::Register virtReg)
Description
clears the specified virtual register's, physical register mapping
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:131
Parameters
- llvm::Register virtReg
¶unsigned int createSpillSlot(
const llvm::TargetRegisterClass* RC)
unsigned int createSpillSlot(
const llvm::TargetRegisterClass* RC)
Description
createSpillSlot - Allocate a spill slot for RC from MFI.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:69
Parameters
- const llvm::TargetRegisterClass* RC
¶void dump() const
void dump() const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:201
¶void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
Description
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:82
Parameters
¶llvm::MachineFunction& getMachineFunction() const
llvm::MachineFunction& getMachineFunction() const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:87
¶llvm::Register getOriginal(
llvm::Register VirtReg) const
llvm::Register getOriginal(
llvm::Register VirtReg) const
Description
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.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:169
Parameters
- llvm::Register VirtReg
¶llvm::MCRegister getPhys(
llvm::Register virtReg) const
llvm::MCRegister getPhys(
llvm::Register virtReg) const
Description
returns the physical register mapped to the specified virtual register
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:105
Parameters
- llvm::Register virtReg
¶llvm::Register getPreSplitReg(
llvm::Register virtReg) const
llvm::Register getPreSplitReg(
llvm::Register virtReg) const
Description
returns the live interval virtReg is split from.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:161
Parameters
- llvm::Register virtReg
¶llvm::MachineRegisterInfo& getRegInfo() const
llvm::MachineRegisterInfo& getRegInfo() const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:92
¶llvm::ShapeT getShape(
llvm::Register virtReg) const
llvm::ShapeT getShape(
llvm::Register virtReg) const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:120
Parameters
- llvm::Register virtReg
¶int getStackSlot(llvm::Register virtReg) const
int getStackSlot(llvm::Register virtReg) const
Description
returns the stack slot mapped to the specified virtual register
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:187
Parameters
- llvm::Register virtReg
¶const llvm::TargetRegisterInfo& getTargetRegInfo()
const
const llvm::TargetRegisterInfo& getTargetRegInfo()
const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:93
¶void grow()
void grow()
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:95
¶bool hasKnownPreference(
llvm::Register VirtReg) const
bool hasKnownPreference(
llvm::Register VirtReg) const
Description
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.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:150
Parameters
- llvm::Register VirtReg
¶bool hasPhys(llvm::Register virtReg) const
bool hasPhys(llvm::Register virtReg) const
Description
returns true if the specified virtual register is mapped to a physical register
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:99
Parameters
- llvm::Register virtReg
¶bool hasPreferredPhys(
llvm::Register VirtReg) const
bool hasPreferredPhys(
llvm::Register VirtReg) const
Description
returns true if VirtReg is assigned to its preferred physreg.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:145
Parameters
- llvm::Register VirtReg
¶bool hasShape(llvm::Register virtReg) const
bool hasShape(llvm::Register virtReg) const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:116
Parameters
- llvm::Register virtReg
¶bool isAssignedReg(llvm::Register virtReg) const
bool isAssignedReg(llvm::Register virtReg) const
Description
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:176
Parameters
- llvm::Register virtReg
¶bool isShapeMapEmpty() const
bool isShapeMapEmpty() const
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:114
¶void print(llvm::raw_ostream& OS,
const llvm::Module* M = nullptr) const
void print(llvm::raw_ostream& OS,
const llvm::Module* M = nullptr) const
Description
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.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:200
Parameters
- llvm::raw_ostream& OS
- const llvm::Module* M = nullptr
¶bool runOnMachineFunction(
llvm::MachineFunction& MF)
bool runOnMachineFunction(
llvm::MachineFunction& MF)
Description
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:80
Parameters
¶void setIsSplitFromReg(llvm::Register virtReg,
llvm::Register SReg)
void setIsSplitFromReg(llvm::Register virtReg,
llvm::Register SReg)
Description
records virtReg is a split live interval from SReg.
Declared at: llvm/include/llvm/CodeGen/VirtRegMap.h:153
Parameters
- llvm::Register virtReg
- llvm::Register SReg