16 #ifndef LLVM_CODEGEN_VIRTREGMAP_H 17 #define LLVM_CODEGEN_VIRTREGMAP_H 28 class MachineFunction;
29 class MachineRegisterInfo;
31 class TargetInstrInfo;
85 assert(MF &&
"getMachineFunction called before runOnMachineFunction");
104 return Virt2PhysMap[virtReg.
id()];
116 "attempt to clear a not assigned virtual register");
122 Virt2PhysMap.
clear();
136 Virt2SplitMap[virtReg.
id()] = SReg;
141 return Virt2SplitMap[virtReg.
id()];
150 return Orig ? Orig : VirtReg;
160 return (Virt2SplitMap[virtReg.
id()] &&
168 return Virt2StackSlotMap[virtReg.
id()];
190 #endif // LLVM_CODEGEN_VIRTREGMAP_H int getStackSlot(Register virtReg) const
returns the stack slot mapped to the specified virtual register
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
bool hasPhys(Register virtReg) const
returns true if the specified virtual register is mapped to a physical register
const TargetRegisterInfo & getTargetRegInfo() const
int assignVirt2StackSlot(Register virtReg)
create a mapping for the specifed virtual register to the next available stack slot ...
unsigned getPreSplitReg(Register virtReg) const
returns the live interval virtReg is split from.
MachineFunction & getMachineFunction() const
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
bool hasPreferredPhys(Register VirtReg)
returns true if VirtReg is assigned to its preferred physreg.
bool isAssignedReg(Register virtReg) const
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
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 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 assignVirt2Phys(Register virtReg, MCPhysReg physReg)
creates a mapping for the specified virtual register to the specified physical register ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
VirtRegMap & operator=(const VirtRegMap &)=delete
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void clearVirt(Register virtReg)
clears the specified virtual register's, physical register mapping
void setIsSplitFromReg(Register virtReg, unsigned SReg)
records virtReg is a split live interval from SReg.
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.
Register getPhys(Register 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
This class implements an extremely fast bulk output stream that can only output to a stream...
bool hasKnownPreference(Register VirtReg)
returns true if VirtReg has a known preferred register.
unsigned getOriginal(unsigned VirtReg) const
getOriginal - Return the original virtual register that VirtReg descends from through splitting...
Wrapper class representing virtual and physical registers.