|
LLVM
4.0.0
|
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand when applying a mapping. More...
#include <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... | |
| MachineInstr & | getMI () const |
| Getters. More... | |
| const InstructionMapping & | getInstrMapping () const |
| The final mapping of the instruction. 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 271 of file RegisterBankInfo.h.
| RegisterBankInfo::OperandsMapper::OperandsMapper | ( | MachineInstr & | MI, |
| const InstructionMapping & | InstrMapping, | ||
| MachineRegisterInfo & | MRI | ||
| ) |
Create an OperandsMapper that will hold the information to apply InstrMapping to MI.
Definition at line 524 of file RegisterBankInfo.cpp.
References assert(), llvm::RegisterBankInfo::InstructionMapping::getNumOperands(), llvm::SmallVectorImpl< T >::resize(), and llvm::RegisterBankInfo::InstructionMapping::verify().
| void RegisterBankInfo::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.
OpIdx-th operand have been assigned a new virtual register. Definition at line 570 of file RegisterBankInfo.cpp.
References assert(), llvm::RegisterBankInfo::ValueMapping::begin(), llvm::MachineRegisterInfo::createGenericVirtualRegister(), llvm::RegisterBankInfo::ValueMapping::end(), llvm::RegisterBankInfo::getInstrMapping(), llvm::RegisterBankInfo::PartialMapping::Length, llvm::RegisterBankInfo::PartialMapping::RegBank, llvm::LLT::scalar(), and llvm::MachineRegisterInfo::setRegBank().
| LLVM_DUMP_METHOD void RegisterBankInfo::OperandsMapper::dump | ( | ) | const |
Print this operands mapper on dbgs() stream.
Definition at line 622 of file RegisterBankInfo.cpp.
References llvm::dbgs().
|
inline |
The final mapping of the instruction.
Definition at line 319 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping().
|
inline |
Getters.
The MachineInstr being remapped.
Definition at line 316 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping().
| iterator_range< SmallVectorImpl< unsigned >::const_iterator > RegisterBankInfo::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.
Definition at line 600 of file RegisterBankInfo.cpp.
References assert(), llvm::WebAssembly::End, llvm::RegisterBankInfo::getInstrMapping(), llvm::make_range(), and llvm::RegisterBankInfo::ValueMapping::NumBreakDowns.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping().
| void RegisterBankInfo::OperandsMapper::print | ( | raw_ostream & | OS, |
| bool | ForDebug = false |
||
| ) | const |
Print this operands mapper on OS stream.
Definition at line 627 of file RegisterBankInfo.cpp.
References llvm::RegisterBankInfo::InstructionMapping::getID(), llvm::RegisterBankInfo::getInstrMapping(), llvm::RegisterBankInfo::InstructionMapping::getNumOperands(), getReg(), and llvm::PrintReg().
| void RegisterBankInfo::OperandsMapper::setVRegs | ( | unsigned | OpIdx, |
| unsigned | PartialMapIdx, | ||
| unsigned | NewVReg | ||
| ) |
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. Definition at line 585 of file RegisterBankInfo.cpp.
References assert(), and llvm::RegisterBankInfo::getInstrMapping().
1.8.6