17 #ifndef LLVM_CODEGEN_VIRTREGMAP_H 18 #define LLVM_CODEGEN_VIRTREGMAP_H 29 class MachineFunction;
30 class MachineRegisterInfo;
32 class TargetInstrInfo;
84 assert(MF &&
"getMachineFunction called before runOnMachineFunction");
103 return Virt2PhysMap[virtReg];
115 "attempt to clear a not assigned virtual register");
121 Virt2PhysMap.
clear();
135 Virt2SplitMap[virtReg] = SReg;
140 return Virt2SplitMap[virtReg];
149 return Orig ? Orig : VirtReg;
159 return (Virt2SplitMap[virtReg] && Virt2PhysMap[virtReg] !=
NO_PHYS_REG);
166 return Virt2StackSlotMap[virtReg];
188 #endif // LLVM_CODEGEN_VIRTREGMAP_H This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
const TargetRegisterInfo & getTargetRegInfo() const
MachineFunction & getMachineFunction() const
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
unsigned getPreSplitReg(unsigned virtReg) const
returns the live interval virtReg is split from.
void setIsSplitFromReg(unsigned virtReg, unsigned SReg)
records virtReg is a split live interval from SReg.
bool isAssignedReg(unsigned virtReg) const
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
TargetInstrInfo - Interface to description of machine instruction set.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachineRegisterInfo & getRegInfo() const
bool hasPreferredPhys(unsigned VirtReg)
returns true if VirtReg is assigned to its preferred physreg.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Represent the analysis usage information of a pass.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool hasKnownPreference(unsigned VirtReg)
returns true if VirtReg has a known preferred register.
VirtRegMap & operator=(const VirtRegMap &)=delete
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void assignVirt2Phys(unsigned virtReg, MCPhysReg 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 setPreservesAll()
Set by analyses that do not transform their input at all.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
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
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void clearAllVirt()
clears all virtual to physical register mappings
int getStackSlot(unsigned virtReg) const
returns the stack slot mapped to the specified virtual register
This class implements an extremely fast bulk output stream that can only output to a stream...
int assignVirt2StackSlot(unsigned virtReg)
create a mapping for the specifed virtual register to the next available stack slot ...
unsigned getOriginal(unsigned VirtReg) const
getOriginal - Return the original virtual register that VirtReg descends from through splitting...