Go to the documentation of this file.
14 #ifndef LLVM_LIB_CODEGEN_REGISTERCOALESCER_H
15 #define LLVM_LIB_CODEGEN_REGISTERCOALESCER_H
22 class TargetRegisterClass;
23 class TargetRegisterInfo;
48 bool CrossClass =
false;
66 :
TRI(tri), DstReg(PhysReg), SrcReg(VirtReg) {}
81 bool isPhys()
const {
return !NewRC; }
114 #endif // LLVM_LIB_CODEGEN_REGISTERCOALESCER_H
This is an optimization pass for GlobalISel generic memory operations.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Register getDstReg() const
Return the register (virtual or physical) that will remain after coalescing.
bool isPhys() const
Return true if DstReg is a physical register.
unsigned const TargetRegisterInfo * TRI
bool flip()
Swap SrcReg and DstReg.
bool isCrossClass() const
Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's.
bool isFlipped() const
Return true when getSrcReg is the register being defined by the original copy instruction.
bool isCoalescable(const MachineInstr *) const
Return true if MI is a copy instruction that will become an identity copy after coalescing.
unsigned getDstIdx() const
Return the subregister index that DstReg will be coalesced into, or 0.
Representation of each machine instruction.
unsigned getSrcIdx() const
Return the subregister index that SrcReg will be coalesced into, or 0.
CoalescerPair(Register VirtReg, MCRegister PhysReg, const TargetRegisterInfo &tri)
Create a CoalescerPair representing a virtreg-to-physreg copy.
CoalescerPair(const TargetRegisterInfo &tri)
A helper class for register coalescers.
Wrapper class representing virtual and physical registers.
Register getSrcReg() const
Return the virtual register that will be coalesced away.
bool setRegisters(const MachineInstr *)
Set registers to match the copy instruction MI.
bool isPartial() const
Return true if the original copy instruction did not copy the full register, but was a subreg operati...
Wrapper class representing physical registers. Should be passed by value.
const TargetRegisterClass * getNewRC() const
Return the register class of the coalesced register.