class CoalescerPair
Declaration
class CoalescerPair { /* full declaration omitted */ };
Description
A helper class for register coalescers. When deciding if two registers can be coalesced, CoalescerPair can determine if a copy instruction would become an identity copy after coalescing.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:26
Method Overview
- public CoalescerPair(const llvm::TargetRegisterInfo & tri)
- public CoalescerPair(unsigned int VirtReg, unsigned int PhysReg, const llvm::TargetRegisterInfo & tri)
- public bool flip()
- public unsigned int getDstIdx() const
- public unsigned int getDstReg() const
- public const llvm::TargetRegisterClass * getNewRC() const
- public unsigned int getSrcIdx() const
- public unsigned int getSrcReg() const
- public bool isCoalescable(const llvm::MachineInstr *) const
- public bool isCrossClass() const
- public bool isFlipped() const
- public bool isPartial() const
- public bool isPhys() const
- public bool setRegisters(const llvm::MachineInstr *)
Methods
¶CoalescerPair(const llvm::TargetRegisterInfo& tri)
CoalescerPair(const llvm::TargetRegisterInfo& tri)
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:58
Parameters
- const llvm::TargetRegisterInfo& tri
¶CoalescerPair(unsigned int VirtReg,
unsigned int PhysReg,
const llvm::TargetRegisterInfo& tri)
CoalescerPair(unsigned int VirtReg,
unsigned int PhysReg,
const llvm::TargetRegisterInfo& tri)
Description
Create a CoalescerPair representing a virtreg-to-physreg copy. No need to call setRegisters().
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:62
Parameters
- unsigned int VirtReg
- unsigned int PhysReg
- const llvm::TargetRegisterInfo& tri
¶bool flip()
bool flip()
Description
Swap SrcReg and DstReg. Return false if swapping is impossible because DstReg is a physical register, or SubIdx is set.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:72
¶unsigned int getDstIdx() const
unsigned int getDstIdx() const
Description
Return the subregister index that DstReg will be coalesced into, or 0.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:101
¶unsigned int getDstReg() const
unsigned int getDstReg() const
Description
Return the register (virtual or physical) that will remain after coalescing.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:95
¶const llvm::TargetRegisterClass* getNewRC() const
const llvm::TargetRegisterClass* getNewRC() const
Description
Return the register class of the coalesced register.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:107
¶unsigned int getSrcIdx() const
unsigned int getSrcIdx() const
Description
Return the subregister index that SrcReg will be coalesced into, or 0.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:104
¶unsigned int getSrcReg() const
unsigned int getSrcReg() const
Description
Return the virtual register that will be coalesced away.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:98
¶bool isCoalescable(
const llvm::MachineInstr*) const
bool isCoalescable(
const llvm::MachineInstr*) const
Description
Return true if MI is a copy instruction that will become an identity copy after coalescing.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:76
Parameters
- const llvm::MachineInstr*
¶bool isCrossClass() const
bool isCrossClass() const
Description
Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:87
¶bool isFlipped() const
bool isFlipped() const
Description
Return true when getSrcReg is the register being defined by the original copy instruction.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:91
¶bool isPartial() const
bool isPartial() const
Description
Return true if the original copy instruction did not copy the full register, but was a subreg operation.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:83
¶bool isPhys() const
bool isPhys() const
Description
Return true if DstReg is a physical register.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:79
¶bool setRegisters(const llvm::MachineInstr*)
bool setRegisters(const llvm::MachineInstr*)
Description
Set registers to match the copy instruction MI. Return false if MI is not a coalescable copy instruction.
Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:68
Parameters
- const llvm::MachineInstr*