LLVM 20.0.0git
|
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/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 . | |
void | createVRegs (unsigned OpIdx) |
Create as many new virtual registers as needed for the mapping of the OpIdx-th operand. | |
void | setVRegs (unsigned OpIdx, unsigned PartialMapIdx, Register NewVReg) |
Set the virtual register of the PartialMapIdx-th partial mapping of the OpIdx-th operand to NewVReg . | |
iterator_range< SmallVectorImpl< Register >::const_iterator > | getVRegs (unsigned OpIdx, bool ForDebug=false) const |
Get all the virtual registers required to map the OpIdx-th operand of the instruction. | |
void | dump () const |
Print this operands mapper on dbgs() stream. | |
void | print (raw_ostream &OS, bool ForDebug=false) const |
Print this operands mapper on OS stream. | |
Getters. | |
The MachineInstr being remapped. | |
MachineInstr & | getMI () const |
const InstructionMapping & | getInstrMapping () const |
The final mapping of the instruction. | |
MachineRegisterInfo & | getMRI () const |
The MachineRegisterInfo we used to realize the mapping. | |
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand when applying a mapping.
Definition at line 281 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 665 of file RegisterBankInfo.cpp.
References assert(), llvm::RegisterBankInfo::InstructionMapping::getNumOperands(), MI, 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. 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. Definition at line 711 of file RegisterBankInfo.cpp.
References assert(), llvm::RegisterBankInfo::ValueMapping::begin(), llvm::RegisterBankInfo::ValueMapping::end(), llvm::RegisterBankInfo::getInstrMapping(), llvm::RegisterBankInfo::PartialMapping::Length, MRI, llvm::RegisterBankInfo::PartialMapping::RegBank, and llvm::LLT::scalar().
Referenced by llvm::RegBankSelect::applyMapping().
LLVM_DUMP_METHOD void RegisterBankInfo::OperandsMapper::dump | ( | ) | const |
Print this operands mapper on dbgs() stream.
Definition at line 769 of file RegisterBankInfo.cpp.
References llvm::dbgs(), and llvm::print().
|
inline |
The final mapping of the instruction.
Definition at line 333 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::RegisterBankInfo::applyMapping(), llvm::AMDGPURegisterBankInfo::applyMappingBFE(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::AMDGPURegisterBankInfo::applyMappingLoad(), and llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad().
|
inline |
Definition at line 330 of file RegisterBankInfo.h.
References MI.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::AMDGPURegisterBankInfo::applyMappingBFE(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::MipsRegisterBankInfo::applyMappingImpl(), llvm::AMDGPURegisterBankInfo::applyMappingMAD_64_32(), llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad(), llvm::AMDGPURegisterBankInfo::applyMappingSMULU64(), and substituteSimpleCopyRegs().
|
inline |
The MachineRegisterInfo we used to realize the mapping.
Definition at line 336 of file RegisterBankInfo.h.
References MRI.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::AMDGPURegisterBankInfo::applyMappingBFE(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::MipsRegisterBankInfo::applyMappingImpl(), llvm::AMDGPURegisterBankInfo::applyMappingMAD_64_32(), llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad(), and llvm::AMDGPURegisterBankInfo::applyMappingSMULU64().
iterator_range< SmallVectorImpl< Register >::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 746 of file RegisterBankInfo.cpp.
References assert(), End, llvm::RegisterBankInfo::getInstrMapping(), llvm::make_range(), and llvm::RegisterBankInfo::ValueMapping::NumBreakDowns.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::RegBankSelect::applyMapping(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::AMDGPURegisterBankInfo::applyMappingLoad(), llvm::AMDGPURegisterBankInfo::applyMappingSMULU64(), and substituteSimpleCopyRegs().
void RegisterBankInfo::OperandsMapper::print | ( | raw_ostream & | OS, |
bool | ForDebug = false |
||
) | const |
Print this operands mapper on OS
stream.
Definition at line 775 of file RegisterBankInfo.cpp.
References llvm::RegisterBankInfo::InstructionMapping::getID(), llvm::RegisterBankInfo::getInstrMapping(), llvm::RegisterBankInfo::InstructionMapping::getNumOperands(), getReg(), Idx, OS, llvm::printReg(), and TRI.
Referenced by llvm::operator<<().
void RegisterBankInfo::OperandsMapper::setVRegs | ( | unsigned | OpIdx, |
unsigned | PartialMapIdx, | ||
Register | 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 731 of file RegisterBankInfo.cpp.
References assert(), and llvm::RegisterBankInfo::getInstrMapping().