LLVM
8.0.1
|
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/GlobalISel/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 | |
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 ValueMapping & | getOperandMapping (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... | |
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 183 of file RegisterBankInfo.h.
|
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.
Definition at line 212 of file RegisterBankInfo.h.
References assert(), getID(), and llvm::RegisterBankInfo::InvalidMappingID.
|
default |
Default constructor.
Use this constructor to express that the mapping is invalid.
LLVM_DUMP_METHOD void RegisterBankInfo::InstructionMapping::dump | ( | ) | const |
Print this on dbgs() stream.
Definition at line 585 of file RegisterBankInfo.cpp.
References llvm::dbgs(), and print().
|
inline |
Get the cost.
Definition at line 226 of file RegisterBankInfo.h.
Referenced by llvm::RegBankSelect::getAnalysisUsage().
|
inline |
Get the ID.
Definition at line 229 of file RegisterBankInfo.h.
Referenced by llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(), and llvm::RegisterBankInfo::OperandsMapper::print().
|
inline |
Get the number of operands.
Definition at line 232 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::RegBankSelect::getAnalysisUsage(), llvm::RegisterBankInfo::OperandsMapper::OperandsMapper(), and llvm::RegisterBankInfo::OperandsMapper::print().
|
inline |
Get the value mapping of the ith operand.
Definition at line 237 of file RegisterBankInfo.h.
|
inline |
Check whether this object is valid.
This is a lightweight check for obvious wrong instance.
Definition at line 252 of file RegisterBankInfo.h.
References llvm::RegisterBankInfo::PartialMapping::dump(), getID(), llvm::RegisterBankInfo::InvalidMappingID, MI, llvm::RegisterBankInfo::PartialMapping::print(), and llvm::RegisterBankInfo::PartialMapping::verify().
Referenced by llvm::RegBankSelect::getAnalysisUsage(), llvm::ARMRegisterBankInfo::getInstrMapping(), llvm::MipsRegisterBankInfo::getInstrMapping(), llvm::AMDGPURegisterBankInfo::getInstrMapping(), llvm::X86RegisterBankInfo::getInstrMapping(), llvm::AArch64RegisterBankInfo::getInstrMapping(), and llvm::RegisterBankInfo::getInstrMapping().
void RegisterBankInfo::InstructionMapping::print | ( | raw_ostream & | OS | ) | const |
|
inline |
Set the mapping for all the operands.
In other words, OpdsMapping should hold at least getNumOperands ValueMapping.
Definition at line 246 of file RegisterBankInfo.h.
bool RegisterBankInfo::InstructionMapping::verify | ( | const MachineInstr & | MI | ) | const |
Verifiy that this mapping makes sense for MI
.
MI
must be connected to a MachineFunction.Definition at line 548 of file RegisterBankInfo.cpp.
References assert(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), isCopyLike(), llvm::MachineOperand::isReg(), and llvm::RegisterBankInfo::ValueMapping::verify().
Referenced by llvm::RegBankSelect::getAnalysisUsage(), and llvm::RegisterBankInfo::OperandsMapper::OperandsMapper().