LLVM 19.0.0git
Public Member Functions | List of all members
llvm::RegisterBankInfo::InstructionMapping Class Reference

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

#include "llvm/CodeGen/RegisterBankInfo.h"

Public Member Functions

 InstructionMapping (unsigned ID, unsigned Cost, const ValueMapping *OperandsMapping, unsigned NumOperands)
 Constructor for the mapping of an instruction.
 InstructionMapping ()=default
 Default constructor.
unsigned getCost () const
 Get the cost.
unsigned getID () const
 Get the ID.
unsigned getNumOperands () const
 Get the number of operands.
const ValueMappinggetOperandMapping (unsigned i) const
 Get the value mapping of the ith operand.
void setOperandsMapping (const ValueMapping *OpdsMapping)
 Set the mapping for all the operands.
bool isValid () const
 Check whether this object is valid.
bool verify (const MachineInstr &MI) const
 Verifiy that this mapping makes sense for MI.
void dump () const
 Print this on dbgs() stream.
void print (raw_ostream &OS) const
 Print this on OS;.

Detailed Description

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

Definition at line 191 of file RegisterBankInfo.h.

Constructor & Destructor Documentation

◆ InstructionMapping() [1/2]

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

Constructor for the mapping of an instruction.

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.

Definition at line 218 of file RegisterBankInfo.h.

◆ InstructionMapping() [2/2]

llvm::RegisterBankInfo::InstructionMapping::InstructionMapping ( )

Default constructor.

Use this constructor to express that the mapping is invalid.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void RegisterBankInfo::InstructionMapping::dump ( ) const

Print this on dbgs() stream.

Definition at line 647 of file RegisterBankInfo.cpp.

References llvm::dbgs(), and llvm::print().

◆ getCost()

unsigned llvm::RegisterBankInfo::InstructionMapping::getCost ( ) const

Get the cost.

Definition at line 229 of file RegisterBankInfo.h.

Referenced by llvm::RegBankSelect::computeMapping().

◆ getID()

unsigned llvm::RegisterBankInfo::InstructionMapping::getID ( ) const

◆ getNumOperands()

unsigned llvm::RegisterBankInfo::InstructionMapping::getNumOperands ( ) const

◆ getOperandMapping()

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

Get the value mapping of the ith operand.

The mapping for the ith operand has been set.
The ith operand is a register.

Definition at line 240 of file RegisterBankInfo.h.

◆ isValid()

bool llvm::RegisterBankInfo::InstructionMapping::isValid ( ) const

◆ print()

void RegisterBankInfo::InstructionMapping::print ( raw_ostream OS) const

Print this on OS;.

Definition at line 653 of file RegisterBankInfo.cpp.

References OS.

Referenced by llvm::operator<<().

◆ setOperandsMapping()

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

Set the mapping for all the operands.

In other words, OpdsMapping should hold at least getNumOperands ValueMapping.

Definition at line 249 of file RegisterBankInfo.h.

◆ verify()

bool RegisterBankInfo::InstructionMapping::verify ( const MachineInstr MI) const

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