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

Methods

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)

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

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

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

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

Description

Return the register class of the coalesced register.

Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:107

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

Description

Return the virtual register that will be coalesced away.

Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:98

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

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

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

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

Description

Return true if DstReg is a physical register.

Declared at: llvm/lib/CodeGen/RegisterCoalescer.h:79

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*