LLVM
8.0.1
|
#include "Target/AMDGPU/AMDGPURegisterBankInfo.h"
Additional Inherited Members | |
Public Types inherited from llvm::RegisterBankInfo | |
using | InstructionMappings = SmallVector< const InstructionMapping *, 4 > |
Convenient type to represent the alternatives for mapping an instruction. More... | |
Static Public Member Functions inherited from llvm::RegisterBankInfo | |
static void | applyDefaultMapping (const OperandsMapper &OpdMapper) |
Helper method to apply something that is like the default mapping. More... | |
static const TargetRegisterClass * | constrainGenericRegister (unsigned Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI) |
Constrain the (possibly generic) virtual register Reg to RC . More... | |
Public Attributes inherited from llvm::RegisterBankInfo | |
struct llvm::RegisterBankInfo::PartialMapping | ScalarAddx2 |
VectorAdd | |
Get the possible mapping for MI . More... | |
Static Public Attributes inherited from llvm::RegisterBankInfo | |
static const unsigned | DefaultMappingID = UINT_MAX |
Identifier used when the related instruction mapping instance is generated by target independent code. More... | |
static const unsigned | InvalidMappingID = UINT_MAX - 1 |
Identifier used when the related instruction mapping instance is generated by the default constructor. More... | |
Protected Member Functions inherited from llvm::RegisterBankInfo | |
RegisterBankInfo (RegisterBank **RegBanks, unsigned NumRegBanks) | |
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances. More... | |
RegisterBankInfo () | |
This constructor is meaningless. More... | |
RegisterBank & | getRegBank (unsigned ID) |
Get the register bank identified by ID . More... | |
const TargetRegisterClass & | getMinimalPhysRegClass (unsigned Reg, const TargetRegisterInfo &TRI) const |
Get the MinimalPhysRegClass for Reg. More... | |
const InstructionMapping & | getInstrMappingImpl (const MachineInstr &MI) const |
Try to get the mapping of MI . More... | |
const PartialMapping & | getPartialMapping (unsigned StartIdx, unsigned Length, const RegisterBank &RegBank) const |
Get the uniquely generated PartialMapping for the given arguments. More... | |
const ValueMapping & | getValueMapping (unsigned StartIdx, unsigned Length, const RegisterBank &RegBank) const |
The most common ValueMapping consists of a single PartialMapping. More... | |
const ValueMapping & | getValueMapping (const PartialMapping *BreakDown, unsigned NumBreakDowns) const |
Get the ValueMapping for the given arguments. More... | |
template<typename Iterator > | |
const ValueMapping * | getOperandsMapping (Iterator Begin, Iterator End) const |
Get the uniquely generated array of ValueMapping for the elements of between Begin and End . More... | |
const ValueMapping * | getOperandsMapping (const SmallVectorImpl< const ValueMapping *> &OpdsMapping) const |
Get the uniquely generated array of ValueMapping for the elements of OpdsMapping . More... | |
const ValueMapping * | getOperandsMapping (std::initializer_list< const ValueMapping *> OpdsMapping) const |
Get the uniquely generated array of ValueMapping for the given arguments. More... | |
Protected Attributes inherited from llvm::RegisterBankInfo | |
RegisterBank ** | RegBanks |
Hold the set of supported register banks. More... | |
unsigned | NumRegBanks |
Total number of register banks. More... | |
DenseMap< unsigned, std::unique_ptr< const PartialMapping > > | MapOfPartialMappings |
Keep dynamically allocated PartialMapping in a separate map. More... | |
DenseMap< unsigned, std::unique_ptr< const ValueMapping > > | MapOfValueMappings |
Keep dynamically allocated ValueMapping in a separate map. More... | |
DenseMap< unsigned, std::unique_ptr< ValueMapping[]> > | MapOfOperandsMappings |
Keep dynamically allocated array of ValueMapping in a separate map. More... | |
DenseMap< unsigned, std::unique_ptr< const InstructionMapping > > | MapOfInstructionMappings |
Keep dynamically allocated InstructionMapping in a separate map. More... | |
DenseMap< unsigned, const TargetRegisterClass * > | PhysRegMinimalRCs |
Getting the minimal register class of a physreg is expensive. More... | |
Definition at line 36 of file AMDGPURegisterBankInfo.h.
AMDGPURegisterBankInfo::AMDGPURegisterBankInfo | ( | const TargetRegisterInfo & | TRI | ) |
Definition at line 34 of file AMDGPURegisterBankInfo.cpp.
References assert(), and llvm::RegisterBankInfo::getRegBank().
|
overridevirtual |
Get the cost of a copy from B
to A
, or put differently, get the cost of A = COPY B.
Since register banks may cover different size, Size
specifies what will be the size in bits that will be copied around.
Reimplemented from llvm::RegisterBankInfo.
Definition at line 73 of file AMDGPURegisterBankInfo.cpp.
References llvm::RegisterBankInfo::copyCost(), llvm::RegisterBank::getID(), and llvm::max().
|
overridevirtual |
Get the alternative mappings for MI
.
Alternative in the sense different from getInstrMapping.
Reimplemented from llvm::RegisterBankInfo.
Definition at line 102 of file AMDGPURegisterBankInfo.cpp.
References llvm::RegisterBankInfo::applyDefaultMapping(), assert(), llvm::RegisterBankInfo::getInstrAlternativeMappings(), llvm::RegisterBankInfo::getInstructionMapping(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::RegisterBankInfo::getOperandsMapping(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::getSizeInBits(), llvm::MachineRegisterInfo::getType(), getValueMapping(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and Size.
|
overridevirtual |
This function must return a legal mapping, because AMDGPURegisterBankInfo::getInstrAlternativeMappings() is not called in RegBankSelect::Mode::Fast.
Any mapping that would cause a VGPR to SGPR generated is illegal.
Reimplemented from llvm::RegisterBankInfo.
Definition at line 385 of file AMDGPURegisterBankInfo.cpp.
References llvm::Intrinsic::amdgcn_cvt_pkrtz, llvm::Intrinsic::amdgcn_exp, llvm::Intrinsic::amdgcn_exp_compr, llvm::Intrinsic::amdgcn_kernarg_segment_ptr, llvm::Intrinsic::amdgcn_wqm_vote, assert(), llvm::RegisterBankInfo::getInstrMappingImpl(), llvm::RegisterBankInfo::getInstructionMapping(), llvm::MachineOperand::getIntrinsicID(), llvm::RegisterBankInfo::getInvalidInstructionMapping(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::RegisterBankInfo::getOperandsMapping(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::getSizeInBits(), llvm::MachineRegisterInfo::getType(), getValueMapping(), isConstant(), llvm::MachineOperand::isReg(), llvm::RegisterBankInfo::InstructionMapping::isValid(), LLVM_FALLTHROUGH, llvm::Intrinsic::maxnum, llvm::Intrinsic::minnum, MRI, and Size.
|
overridevirtual |
Get a register bank that covers RC
.
RC
is a user-defined register class (as opposed as one generated by TableGen).Reimplemented from llvm::RegisterBankInfo.
Definition at line 92 of file AMDGPURegisterBankInfo.cpp.
References llvm::RegisterBankInfo::getRegBank(), and llvm::SIRegisterInfo::isSGPRClass().