|
LLVM
3.7.0
|
A helper class for register coalescers. More...
#include <RegisterCoalescer.h>
Public Member Functions | |
| CoalescerPair (const TargetRegisterInfo &tri) | |
| CoalescerPair (unsigned VirtReg, unsigned PhysReg, const TargetRegisterInfo &tri) | |
| Create a CoalescerPair representing a virtreg-to-physreg copy. More... | |
| bool | setRegisters (const MachineInstr *) |
| Set registers to match the copy instruction MI. More... | |
| bool | flip () |
| Swap SrcReg and DstReg. More... | |
| bool | isCoalescable (const MachineInstr *) const |
| Return true if MI is a copy instruction that will become an identity copy after coalescing. More... | |
| bool | isPhys () const |
| Return true if DstReg is a physical register. More... | |
| bool | isPartial () const |
| Return true if the original copy instruction did not copy the full register, but was a subreg operation. More... | |
| bool | isCrossClass () const |
| Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's. More... | |
| bool | isFlipped () const |
| Return true when getSrcReg is the register being defined by the original copy instruction. More... | |
| unsigned | getDstReg () const |
| Return the register (virtual or physical) that will remain after coalescing. More... | |
| unsigned | getSrcReg () const |
| Return the virtual register that will be coalesced away. More... | |
| unsigned | getDstIdx () const |
| Return the subregister index that DstReg will be coalesced into, or 0. More... | |
| unsigned | getSrcIdx () const |
| Return the subregister index that SrcReg will be coalesced into, or 0. More... | |
| const TargetRegisterClass * | getNewRC () const |
| Return the register class of the coalesced register. More... | |
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.
Definition at line 28 of file RegisterCoalescer.h.
|
inline |
Definition at line 60 of file RegisterCoalescer.h.
|
inline |
Create a CoalescerPair representing a virtreg-to-physreg copy.
No need to call setRegisters().
Definition at line 66 of file RegisterCoalescer.h.
| bool CoalescerPair::flip | ( | ) |
Swap SrcReg and DstReg.
Return false if swapping is impossible because DstReg is a physical register, or SubIdx is set.
Definition at line 407 of file RegisterCoalescer.cpp.
References llvm::TargetRegisterInfo::isPhysicalRegister(), and std::swap().
|
inline |
Return the subregister index that DstReg will be coalesced into, or 0.
Definition at line 106 of file RegisterCoalescer.h.
|
inline |
Return the register (virtual or physical) that will remain after coalescing.
Definition at line 100 of file RegisterCoalescer.h.
|
inline |
Return the register class of the coalesced register.
Definition at line 112 of file RegisterCoalescer.h.
|
inline |
Return the subregister index that SrcReg will be coalesced into, or 0.
Definition at line 109 of file RegisterCoalescer.h.
|
inline |
Return the virtual register that will be coalesced away.
Definition at line 103 of file RegisterCoalescer.h.
| bool CoalescerPair::isCoalescable | ( | const MachineInstr * | MI | ) | const |
Return true if MI is a copy instruction that will become an identity copy after coalescing.
Definition at line 416 of file RegisterCoalescer.cpp.
References llvm::TargetRegisterInfo::composeSubRegIndices(), llvm::MCRegisterInfo::getSubReg(), isMoveInstr(), llvm::TargetRegisterInfo::isPhysicalRegister(), and std::swap().
Referenced by llvm::LiveRange::overlaps().
|
inline |
Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's.
Definition at line 92 of file RegisterCoalescer.h.
|
inline |
Return true when getSrcReg is the register being defined by the original copy instruction.
Definition at line 96 of file RegisterCoalescer.h.
|
inline |
Return true if the original copy instruction did not copy the full register, but was a subreg operation.
Definition at line 88 of file RegisterCoalescer.h.
|
inline |
Return true if DstReg is a physical register.
Definition at line 84 of file RegisterCoalescer.h.
| bool CoalescerPair::setRegisters | ( | const MachineInstr * | MI | ) |
Set registers to match the copy instruction MI.
Return false if MI is not a coalescable copy instruction.
Definition at line 319 of file RegisterCoalescer.cpp.
References llvm::TargetRegisterClass::contains(), llvm::TargetRegisterInfo::getCommonSubClass(), llvm::TargetRegisterInfo::getCommonSuperRegClass(), llvm::TargetRegisterInfo::getMatchingSuperReg(), llvm::TargetRegisterInfo::getMatchingSuperRegClass(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::MCRegisterInfo::getSubReg(), isMoveInstr(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::TargetRegisterInfo::isVirtualRegister(), and std::swap().
1.8.6