LLVM
8.0.1
|
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand when applying a mapping. More...
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
Public Member Functions | |
OperandsMapper (MachineInstr &MI, const InstructionMapping &InstrMapping, MachineRegisterInfo &MRI) | |
Create an OperandsMapper that will hold the information to apply InstrMapping to MI . More... | |
void | createVRegs (unsigned OpIdx) |
Create as many new virtual registers as needed for the mapping of the OpIdx-th operand. More... | |
void | setVRegs (unsigned OpIdx, unsigned PartialMapIdx, unsigned NewVReg) |
Set the virtual register of the PartialMapIdx-th partial mapping of the OpIdx-th operand to NewVReg . More... | |
iterator_range< SmallVectorImpl< unsigned >::const_iterator > | getVRegs (unsigned OpIdx, bool ForDebug=false) const |
Get all the virtual registers required to map the OpIdx-th operand of the instruction. More... | |
void | dump () const |
Print this operands mapper on dbgs() stream. More... | |
void | print (raw_ostream &OS, bool ForDebug=false) const |
Print this operands mapper on OS stream. More... | |
Getters. | |
The MachineInstr being remapped. | |
MachineInstr & | getMI () const |
const InstructionMapping & | getInstrMapping () const |
The final mapping of the instruction. More... | |
MachineRegisterInfo & | getMRI () const |
The MachineRegisterInfo we used to realize the mapping. More... | |
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand when applying a mapping.
Definition at line 994 of file RegisterBankInfo.h.
OperandsMapper::OperandsMapper | ( | MachineInstr & | MI, |
const InstructionMapping & | InstrMapping, | ||
MachineRegisterInfo & | MRI | ||
) |
Create an OperandsMapper that will hold the information to apply InstrMapping
to MI
.
void OperandsMapper::createVRegs | ( | unsigned | OpIdx | ) |
Create as many new virtual registers as needed for the mapping of the 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.
OpIdx-th
operand have been assigned a new virtual register. void OperandsMapper::dump | ( | ) | const |
Print this operands mapper on dbgs() stream.
|
inline |
The final mapping of the instruction.
Definition at line 1046 of file RegisterBankInfo.h.
Referenced by llvm::applyMapping().
|
inline |
Definition at line 1043 of file RegisterBankInfo.h.
|
inline |
The MachineRegisterInfo we used to realize the mapping.
Definition at line 1049 of file RegisterBankInfo.h.
iterator_range<SmallVectorImpl<unsigned>::const_iterator> OperandsMapper::getVRegs | ( | unsigned | OpIdx, |
bool | ForDebug = false |
||
) | const |
Get all the virtual registers required to map the 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 ForDebug
is true, we will not check that the list of new virtual registers does not contain uninitialized values.
Print this operands mapper on OS
stream.
Set the virtual register of the PartialMapIdx-th
partial mapping of the OpIdx-th operand to NewVReg
.
PartialMapIdx-th
register of the value mapping of the OpIdx-th
operand has been set.