class RegisterBankInfo::InstructionMapping

Declaration

class RegisterBankInfo::InstructionMapping { /* full declaration omitted */ };

Description

Helper class that represents how the value of an instruction may be mapped and what is the related cost of such mapping.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:188

Method Overview

  • public InstructionMapping(unsigned int ID, unsigned int Cost, const llvm::RegisterBankInfo::ValueMapping * OperandsMapping, unsigned int NumOperands)
  • public InstructionMapping()
  • public void dump() const
  • public unsigned int getCost() const
  • public unsigned int getID() const
  • public unsigned int getNumOperands() const
  • public const llvm::RegisterBankInfo::ValueMapping & getOperandMapping(unsigned int i) const
  • public bool isValid() const
  • public void print(llvm::raw_ostream & OS) const
  • public void setOperandsMapping(const llvm::RegisterBankInfo::ValueMapping * OpdsMapping)
  • public bool verify(const llvm::MachineInstr & MI) const

Methods

InstructionMapping(
    unsigned int ID,
    unsigned int Cost,
    const llvm::RegisterBankInfo::ValueMapping*
        OperandsMapping,
    unsigned int NumOperands)

Description

Constructor for the mapping of an instruction.\p NumOperands must be equal to number of all the operands of the related instruction. The rationale is that it is more efficient for the optimizers to be able to assume that the mapping of the ith operand is at the index i.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:215

Parameters

unsigned int ID
unsigned int Cost
const llvm::RegisterBankInfo::ValueMapping* OperandsMapping
unsigned int NumOperands

InstructionMapping()

Description

Default constructor. Use this constructor to express that the mapping is invalid.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:224

void dump() const

Description

Print this on dbgs() stream.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:266

unsigned int getCost() const

Description

Get the cost.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:227

unsigned int getID() const

Description

Get the ID.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:230

unsigned int getNumOperands() const

Description

Get the number of operands.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:233

const llvm::RegisterBankInfo::ValueMapping&
getOperandMapping(unsigned int i) const

Description

Get the value mapping of the ith operand.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:238

Parameters

unsigned int i

bool isValid() const

Description

Check whether this object is valid. This is a lightweight check for obvious wrong instance.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:253

void print(llvm::raw_ostream& OS) const

Description

Print this on \p OS;

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:269

Parameters

llvm::raw_ostream& OS

void setOperandsMapping(
    const llvm::RegisterBankInfo::ValueMapping*
        OpdsMapping)

Description

Set the mapping for all the operands. In other words, OpdsMapping should hold at least getNumOperands ValueMapping.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:247

Parameters

const llvm::RegisterBankInfo::ValueMapping* OpdsMapping

bool verify(const llvm::MachineInstr& MI) const

Description

Verifiy that this mapping makes sense for \p MI.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h:263

Parameters

const llvm::MachineInstr& MI

Returns

True is the check was successful.