17 #ifndef LLVM_CODEGEN_VIRTREGMAP_H
18 #define LLVM_CODEGEN_VIRTREGMAP_H
26 class MachineFunction;
27 class MachineRegisterInfo;
28 class TargetInstrInfo;
67 void operator=(const
VirtRegMap&) LLVM_DELETED_FUNCTION;
81 assert(MF &&
"getMachineFunction called before runOnMachineFunction");
98 unsigned getPhys(
unsigned virtReg)
const {
100 return Virt2PhysMap[virtReg];
109 "attempt to assign physical register to already mapped "
111 Virt2PhysMap[virtReg] = physReg;
119 "attempt to clear a not assigned virtual register");
125 Virt2PhysMap.clear();
139 Virt2SplitMap[virtReg] = SReg;
144 return Virt2SplitMap[virtReg];
153 return Orig ? Orig : VirtReg;
163 return (Virt2SplitMap[virtReg] && Virt2PhysMap[virtReg] !=
NO_PHYS_REG);
170 return Virt2StackSlotMap[virtReg];
bool hasPhys(unsigned virtReg) const
returns true if the specified virtual register is mapped to a physical register
MachineFunction & getMachineFunction() const
The main container class for the LLVM Intermediate Representation.
static bool isVirtualRegister(unsigned Reg)
void assignVirt2Phys(unsigned virtReg, unsigned physReg)
creates a mapping for the specified virtual register to the specified physical register ...
void print(raw_ostream &OS, const Module *M=0) const
virtual bool runOnMachineFunction(MachineFunction &MF)
void setIsSplitFromReg(unsigned virtReg, unsigned SReg)
records virtReg is a split live interval from SReg.
unsigned getOriginal(unsigned VirtReg) const
bool hasPreferredPhys(unsigned VirtReg)
returns true if VirtReg is assigned to its preferred physreg.
const TargetRegisterInfo & getTargetRegInfo() const
bool hasKnownPreference(unsigned VirtReg)
returns true if VirtReg has a known preferred register. This returns false if VirtReg has a preferenc...
#define LLVM_DELETED_FUNCTION
void clearVirt(unsigned virtReg)
clears the specified virtual register's, physical register mapping
static bool isPhysicalRegister(unsigned Reg)
virtual void getAnalysisUsage(AnalysisUsage &AU) const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
bool isAssignedReg(unsigned virtReg) const
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
void clearAllVirt()
clears all virtual to physical register mappings
int getStackSlot(unsigned virtReg) const
returns the stack slot mapped to the specified virtual register
virtual void getAnalysisUsage(AnalysisUsage &AU) const
MachineRegisterInfo & getRegInfo() const
int assignVirt2StackSlot(unsigned virtReg)
create a mapping for the specifed virtual register to the next available stack slot ...
unsigned getPhys(unsigned virtReg) const
returns the physical register mapped to the specified virtual register
unsigned getPreSplitReg(unsigned virtReg) const
returns the live interval virtReg is split from.