LLVM API Documentation

Public Member Functions
llvm::CoalescerPair Class Reference

#include <RegisterCoalescer.h>

List of all members.

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 TargetRegisterClassgetNewRC () const
 getNewRC - Return the register class of the coalesced register.

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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().

getDstIdx - Return the subregister index that DstReg will be coalesced into, or 0.

Definition at line 109 of file RegisterCoalescer.h.

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().

getNewRC - Return the register class of the coalesced register.

Definition at line 116 of file RegisterCoalescer.h.

getSrcIdx - Return the subregister index that SrcReg will be coalesced into, or 0.

Definition at line 113 of file RegisterCoalescer.h.

getSrcReg - Return the virtual register that will be coalesced away.

Definition at line 105 of file RegisterCoalescer.h.

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().

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.

isFlipped - Return true when getSrcReg is the register being defined by the original copy instruction.

Definition at line 98 of file RegisterCoalescer.h.

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.


The documentation for this class was generated from the following files: