LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::CoalescerPair Class Reference

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

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

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.

Member Function Documentation

bool CoalescerPair::flip ( )

flip - Swap SrcReg and DstReg. Return false if swapping is impossible because DstReg is a physical register, or SubIdx is set.

Definition at line 341 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.

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 350 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.

bool CoalescerPair::setRegisters ( const MachineInstr MI)

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