LLVM  4.0.0
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 <RegisterBankInfo.h>

Public Member Functions

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

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 179 of file RegisterBankInfo.h.

Constructor & Destructor Documentation

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

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.

Precondition
ID != InvalidMappingID

Definition at line 205 of file RegisterBankInfo.h.

References assert(), getID(), and llvm::RegisterBankInfo::InvalidMappingID.

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

Default constructor.

Use this constructor to express that the mapping is invalid.

Definition at line 216 of file RegisterBankInfo.h.

Member Function Documentation

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

Print this on dbgs() stream.

Definition at line 506 of file RegisterBankInfo.cpp.

References llvm::dbgs().

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

Get the cost.

Definition at line 219 of file RegisterBankInfo.h.

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

Get the value mapping of the ith operand.

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

Definition at line 230 of file RegisterBankInfo.h.

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

Check whether this object is valid.

This is a lightweight check for obvious wrong instance.

Definition at line 245 of file RegisterBankInfo.h.

References getID(), and llvm::RegisterBankInfo::InvalidMappingID.

Referenced by llvm::ARMRegisterBankInfo::getInstrMapping(), llvm::AArch64RegisterBankInfo::getInstrMapping(), and llvm::RegisterBankInfo::getInstrMapping().

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

Print this on OS;.

Definition at line 511 of file RegisterBankInfo.cpp.

References getID().

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

Set the mapping for all the operands.

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

Definition at line 239 of file RegisterBankInfo.h.

Referenced by llvm::AArch64RegisterBankInfo::getInstrMapping(), and llvm::RegisterBankInfo::getInstrMappingImpl().

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

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