class RegisterBankInfo::OperandsMapper
Declaration
class RegisterBankInfo::OperandsMapper { /* full declaration omitted */ };Description
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand when applying a mapping.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:279
Member Variables
- private SmallVector<int, 8> OpToNewVRegIdx
- The OpIdx-th cell contains the index in NewVRegs where the VRegs of the OpIdx-th operand starts. -1 means we do not have such mapping yet. Note: We use a SmallVector to avoid heap allocation for most cases.
- private SmallVector<llvm::Register, 8> NewVRegs
- Hold the registers that will be used to map MI with InstrMapping.
- private llvm::MachineRegisterInfo& MRI
- Current MachineRegisterInfo, used to create new virtual registers.
- private llvm::MachineInstr& MI
- Instruction being remapped.
- private const llvm::RegisterBankInfo::InstructionMapping& InstrMapping
- New mapping of the instruction.
- private static const int DontKnowIdx
- Constant value identifying that the index in OpToNewVRegIdx for an operand has not been set yet.
Method Overview
- public OperandsMapper(llvm::MachineInstr & MI, const llvm::RegisterBankInfo::InstructionMapping & InstrMapping, llvm::MachineRegisterInfo & MRI)
- public void createVRegs(unsigned int OpIdx)
- public void dump() const
- public const llvm::RegisterBankInfo::InstructionMapping & getInstrMapping() const
- public llvm::MachineInstr & getMI() const
- public llvm::MachineRegisterInfo & getMRI() const
- private SmallVectorImpl<Register>::const_iterator getNewVRegsEnd(unsigned int StartIdx, unsigned int NumVal) const
- private SmallVectorImpl<Register>::iterator getNewVRegsEnd(unsigned int StartIdx, unsigned int NumVal)
- public iterator_range<SmallVectorImpl<Register>::const_iterator> getVRegs(unsigned int OpIdx, bool ForDebug = false) const
- private iterator_range<SmallVectorImpl<Register>::iterator> getVRegsMem(unsigned int OpIdx)
- public void print(llvm::raw_ostream & OS, bool ForDebug = false) const
- public void setVRegs(unsigned int OpIdx, unsigned int PartialMapIdx, llvm::Register NewVReg)
Methods
¶OperandsMapper(
llvm::MachineInstr& MI,
const llvm::RegisterBankInfo::
InstructionMapping& InstrMapping,
llvm::MachineRegisterInfo& MRI)
OperandsMapper(
llvm::MachineInstr& MI,
const llvm::RegisterBankInfo::
InstructionMapping& InstrMapping,
llvm::MachineRegisterInfo& MRI)Description
Create an OperandsMapper that will hold the information to apply \p InstrMapping to \p MI.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:322
Parameters
- llvm::MachineInstr& MI
- const llvm::RegisterBankInfo::InstructionMapping& InstrMapping
- llvm::MachineRegisterInfo& MRI
¶void createVRegs(unsigned int OpIdx)
void createVRegs(unsigned int OpIdx)Description
Create as many new virtual registers as needed for the mapping of the \p OpIdx-th operand. The number of registers is determined by the number of breakdown for the related operand in the instruction mapping. The type of the new registers is a plain scalar of the right size. The proper type is expected to be set when the mapping is applied to the instruction(s) that realizes the mapping.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:349
Parameters
- unsigned int OpIdx
¶void dump() const
void dump() constDescription
Print this operands mapper on dbgs() stream.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:379
¶const llvm::RegisterBankInfo::InstructionMapping&
getInstrMapping() const
const llvm::RegisterBankInfo::InstructionMapping&
getInstrMapping() constDescription
The final mapping of the instruction.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:331
¶llvm::MachineInstr& getMI() const
llvm::MachineInstr& getMI() constDescription
@ { The MachineInstr being remapped.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:328
¶llvm::MachineRegisterInfo& getMRI() const
llvm::MachineRegisterInfo& getMRI() constDescription
The MachineRegisterInfo we used to realize the mapping.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:334
¶SmallVectorImpl<Register>::const_iterator
getNewVRegsEnd(unsigned int StartIdx,
unsigned int NumVal) const
SmallVectorImpl<Register>::const_iterator
getNewVRegsEnd(unsigned int StartIdx,
unsigned int NumVal) constDescription
Get the end iterator for a range starting at \p StartIdx and spannig \p NumVal in NewVRegs.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:314
Parameters
- unsigned int StartIdx
- unsigned int NumVal
¶SmallVectorImpl<Register>::iterator
getNewVRegsEnd(unsigned int StartIdx,
unsigned int NumVal)
SmallVectorImpl<Register>::iterator
getNewVRegsEnd(unsigned int StartIdx,
unsigned int NumVal)Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:315
Parameters
- unsigned int StartIdx
- unsigned int NumVal
¶iterator_range<
SmallVectorImpl<Register>::const_iterator>
getVRegs(unsigned int OpIdx,
bool ForDebug = false) const
iterator_range<
SmallVectorImpl<Register>::const_iterator>
getVRegs(unsigned int OpIdx,
bool ForDebug = false) constDescription
Get all the virtual registers required to map the \p OpIdx-th operand of the instruction. This return an empty range when createVRegs or setVRegs has not been called. The iterator may be invalidated by a call to setVRegs or createVRegs. When \p ForDebug is true, we will not check that the list of new virtual registers does not contain uninitialized values.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:376
Parameters
- unsigned int OpIdx
- bool ForDebug = false
¶iterator_range<
SmallVectorImpl<Register>::iterator>
getVRegsMem(unsigned int OpIdx)
iterator_range<
SmallVectorImpl<Register>::iterator>
getVRegsMem(unsigned int OpIdx)Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:308
Parameters
- unsigned int OpIdx
¶void print(llvm::raw_ostream& OS,
bool ForDebug = false) const
void print(llvm::raw_ostream& OS,
bool ForDebug = false) constDescription
Print this operands mapper on \p OS stream.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:382
Parameters
- llvm::raw_ostream& OS
- bool ForDebug = false
¶void setVRegs(unsigned int OpIdx,
unsigned int PartialMapIdx,
llvm::Register NewVReg)
void setVRegs(unsigned int OpIdx,
unsigned int PartialMapIdx,
llvm::Register NewVReg)Description
Set the virtual register of the \p PartialMapIdx-th partial mapping of the OpIdx-th operand to \p NewVReg.
Declared at: llvm/include/llvm/CodeGen/RegisterBankInfo.h:361
Parameters
- unsigned int OpIdx
- unsigned int PartialMapIdx
- llvm::Register NewVReg