LLVM API Documentation
#include <RegisterCoalescer.h>
Public Member Functions | |
CoalescerPair (const TargetRegisterInfo &tri) | |
CoalescerPair (unsigned VirtReg, unsigned PhysReg, const TargetRegisterInfo &tri) | |
bool | setRegisters (const MachineInstr *) |
bool | flip () |
bool | isCoalescable (const MachineInstr *) const |
bool | isPhys () const |
isPhys - Return true if DstReg is a physical register. | |
bool | isPartial () const |
bool | isCrossClass () const |
bool | isFlipped () const |
unsigned | getDstReg () const |
unsigned | getSrcReg () const |
getSrcReg - Return the virtual register that will be coalesced away. | |
unsigned | getDstIdx () const |
unsigned | getSrcIdx () const |
const TargetRegisterClass * | getNewRC () const |
getNewRC - Return the register class of the coalesced register. |
CoalescerPair - 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.
llvm::CoalescerPair::CoalescerPair | ( | const TargetRegisterInfo & | tri | ) | [inline] |
Definition at line 62 of file RegisterCoalescer.h.
llvm::CoalescerPair::CoalescerPair | ( | unsigned | VirtReg, |
unsigned | PhysReg, | ||
const TargetRegisterInfo & | tri | ||
) | [inline] |
Create a CoalescerPair representing a virtreg-to-physreg copy. No need to call setRegisters().
Definition at line 68 of file RegisterCoalescer.h.
flip - Swap SrcReg and DstReg. Return false if swapping is impossible because DstReg is a physical register, or SubIdx is set.
Definition at line 339 of file RegisterCoalescer.cpp.
References llvm::TargetRegisterInfo::isPhysicalRegister(), and std::swap().
unsigned llvm::CoalescerPair::getDstIdx | ( | ) | const [inline] |
getDstIdx - Return the subregister index that DstReg will be coalesced into, or 0.
Definition at line 109 of file RegisterCoalescer.h.
unsigned llvm::CoalescerPair::getDstReg | ( | ) | const [inline] |
getDstReg - Return the register (virtual or physical) that will remain after coalescing.
Definition at line 102 of file RegisterCoalescer.h.
Referenced by llvm::PBQPBuilderWithCoalescing::build().
const TargetRegisterClass* llvm::CoalescerPair::getNewRC | ( | ) | const [inline] |
getNewRC - Return the register class of the coalesced register.
Definition at line 116 of file RegisterCoalescer.h.
unsigned llvm::CoalescerPair::getSrcIdx | ( | ) | const [inline] |
getSrcIdx - Return the subregister index that SrcReg will be coalesced into, or 0.
Definition at line 113 of file RegisterCoalescer.h.
unsigned llvm::CoalescerPair::getSrcReg | ( | ) | const [inline] |
getSrcReg - Return the virtual register that will be coalesced away.
Definition at line 105 of file RegisterCoalescer.h.
bool CoalescerPair::isCoalescable | ( | const MachineInstr * | MI | ) | const |
isCoalescable - Return true if MI is a copy instruction that will become an identity copy after coalescing.
Definition at line 348 of file RegisterCoalescer.cpp.
References llvm::TargetRegisterInfo::composeSubRegIndices(), llvm::MCRegisterInfo::getSubReg(), isMoveInstr(), llvm::TargetRegisterInfo::isPhysicalRegister(), and std::swap().
Referenced by llvm::LiveRange::overlaps().
bool llvm::CoalescerPair::isCrossClass | ( | ) | const [inline] |
isCrossClass - Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's.
Definition at line 94 of file RegisterCoalescer.h.
bool llvm::CoalescerPair::isFlipped | ( | ) | const [inline] |
isFlipped - Return true when getSrcReg is the register being defined by the original copy instruction.
Definition at line 98 of file RegisterCoalescer.h.
bool llvm::CoalescerPair::isPartial | ( | ) | const [inline] |
isPartial - Return true if the original copy instruction did not copy the full register, but was a subreg operation.
Definition at line 90 of file RegisterCoalescer.h.
bool llvm::CoalescerPair::isPhys | ( | ) | const [inline] |
isPhys - Return true if DstReg is a physical register.
Definition at line 86 of file RegisterCoalescer.h.
setRegisters - set registers to match the copy instruction MI. Return false if MI is not a coalescable copy instruction.
Definition at line 251 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().