LLVM 20.0.0git
Protected Types | Static Protected Member Functions | Static Protected Attributes | List of all members
llvm::AArch64GenRegisterBankInfo Class Reference

#include "Target/AArch64/GISel/AArch64RegisterBankInfo.h"

Inheritance diagram for llvm::AArch64GenRegisterBankInfo:
Inheritance graph
[legend]

Protected Types

enum  PartialMappingIdx {
  PMI_None = -1 , PMI_FPR16 = 1 , PMI_FPR32 , PMI_FPR64 ,
  PMI_FPR128 , PMI_FPR256 , PMI_FPR512 , PMI_GPR32 ,
  PMI_GPR64 , PMI_GPR128 , PMI_FirstGPR = PMI_GPR32 , PMI_LastGPR = PMI_GPR128 ,
  PMI_FirstFPR = PMI_FPR16 , PMI_LastFPR = PMI_FPR512 , PMI_Min = PMI_FirstFPR
}
 
enum  ValueMappingIdx {
  InvalidIdx = 0 , First3OpsIdx = 1 , Last3OpsIdx = 25 , DistanceBetweenRegBanks = 3 ,
  FirstCrossRegCpyIdx = 28 , LastCrossRegCpyIdx = 42 , DistanceBetweenCrossRegCpy = 2 , FPExt16To32Idx = 44 ,
  FPExt16To64Idx = 46 , FPExt32To64Idx = 48 , FPExt64To128Idx = 50 , Shift64Imm = 52
}
 

Static Protected Member Functions

static bool checkPartialMap (unsigned Idx, unsigned ValStartIdx, unsigned ValLength, const RegisterBank &RB)
 
static bool checkValueMapImpl (unsigned Idx, unsigned FirstInBank, unsigned Size, unsigned Offset)
 
static bool checkPartialMappingIdx (PartialMappingIdx FirstAlias, PartialMappingIdx LastAlias, ArrayRef< PartialMappingIdx > Order)
 
static unsigned getRegBankBaseIdxOffset (unsigned RBIdx, TypeSize Size)
 
static const RegisterBankInfo::ValueMappinggetValueMapping (PartialMappingIdx RBIdx, TypeSize Size)
 Get the pointer to the ValueMapping representing the RegisterBank at RBIdx with a size of Size.
 
static const RegisterBankInfo::ValueMappinggetCopyMapping (unsigned DstBankID, unsigned SrcBankID, TypeSize Size)
 Get the pointer to the ValueMapping of the operands of a copy instruction from the SrcBankID register bank to the DstBankID register bank with a size of Size.
 
static const RegisterBankInfo::ValueMappinggetFPExtMapping (unsigned DstSize, unsigned SrcSize)
 Get the instruction mapping for G_FPEXT.
 

Static Protected Attributes

static const RegisterBankInfo::PartialMapping PartMappings []
 
static const RegisterBankInfo::ValueMapping ValMappings []
 
static const PartialMappingIdx BankIDToCopyMapIdx []
 

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.
 
- Public Member Functions inherited from llvm::RegisterBankInfo
const RegisterBankgetRegBankFromConstraints (const MachineInstr &MI, unsigned OpIdx, const TargetInstrInfo &TII, const MachineRegisterInfo &MRI) const
 Get the register bank for the OpIdx-th operand of MI form the encoding constraints, if any.
 
virtual void applyMappingImpl (MachineIRBuilder &Builder, const OperandsMapper &OpdMapper) const
 See applyMapping.
 
virtual ~RegisterBankInfo ()=default
 
const RegisterBankgetRegBank (unsigned ID) const
 Get the register bank identified by ID.
 
unsigned getMaximumSize (unsigned RegBankID) const
 Get the maximum size in bits that fits in the given register bank.
 
const RegisterBankgetRegBank (Register Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
 Get the register bank of Reg.
 
unsigned getNumRegBanks () const
 Get the total number of register banks.
 
virtual bool isDivergentRegBank (const RegisterBank *RB) const
 Returns true if the register bank is considered divergent.
 
virtual const RegisterBankgetRegBankFromRegClass (const TargetRegisterClass &RC, LLT Ty) const
 Get a register bank that covers RC.
 
virtual unsigned copyCost (const RegisterBank &A, const RegisterBank &B, TypeSize Size) const
 Get the cost of a copy from B to A, or put differently, get the cost of A = COPY B.
 
bool cannotCopy (const RegisterBank &Dst, const RegisterBank &Src, TypeSize Size) const
 
virtual unsigned getBreakDownCost (const ValueMapping &ValMapping, const RegisterBank *CurBank=nullptr) const
 Get the cost of using ValMapping to decompose a register.
 
virtual const InstructionMappinggetInstrMapping (const MachineInstr &MI) const
 Get the mapping of the different operands of MI on the register bank.
 
virtual InstructionMappings getInstrAlternativeMappings (const MachineInstr &MI) const
 Get the alternative mappings for MI.
 
InstructionMappings getInstrPossibleMappings (const MachineInstr &MI) const
 Get the possible mapping for MI.
 
void applyMapping (MachineIRBuilder &Builder, const OperandsMapper &OpdMapper) const
 Apply OpdMapper.getInstrMapping() to OpdMapper.getMI().
 
TypeSize getSizeInBits (Register Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
 Get the size in bits of Reg.
 
bool verify (const TargetRegisterInfo &TRI) const
 Check that information hold by this instance make sense for the given TRI.
 
const InstructionMappinggetInstructionMapping (unsigned ID, unsigned Cost, const ValueMapping *OperandsMapping, unsigned NumOperands) const
 Method to get a uniquely generated InstructionMapping.
 
const InstructionMappinggetInvalidInstructionMapping () const
 Method to get a uniquely generated invalid InstructionMapping.
 
- 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.
 
static const TargetRegisterClassconstrainGenericRegister (Register Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI)
 Constrain the (possibly generic) virtual register Reg to RC.
 
- 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.
 
static const unsigned InvalidMappingID = UINT_MAX - 1
 Identifier used when the related instruction mapping instance is generated by the default constructor.
 
- Protected Member Functions inherited from llvm::RegisterBankInfo
 RegisterBankInfo (const RegisterBank **RegBanks, unsigned NumRegBanks, const unsigned *Sizes, unsigned HwMode)
 Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
 
 RegisterBankInfo ()
 This constructor is meaningless.
 
const RegisterBankgetRegBank (unsigned ID)
 Get the register bank identified by ID.
 
const TargetRegisterClassgetMinimalPhysRegClass (Register Reg, const TargetRegisterInfo &TRI) const
 Get the MinimalPhysRegClass for Reg.
 
const InstructionMappinggetInstrMappingImpl (const MachineInstr &MI) const
 Try to get the mapping of MI.
 
const PartialMappinggetPartialMapping (unsigned StartIdx, unsigned Length, const RegisterBank &RegBank) const
 Get the uniquely generated PartialMapping for the given arguments.
 
const ValueMappinggetValueMapping (unsigned StartIdx, unsigned Length, const RegisterBank &RegBank) const
 The most common ValueMapping consists of a single PartialMapping.
 
const ValueMappinggetValueMapping (const PartialMapping *BreakDown, unsigned NumBreakDowns) const
 Get the ValueMapping for the given arguments.
 
template<typename Iterator >
const ValueMappinggetOperandsMapping (Iterator Begin, Iterator End) const
 Get the uniquely generated array of ValueMapping for the elements of between Begin and End.
 
const ValueMappinggetOperandsMapping (const SmallVectorImpl< const ValueMapping * > &OpdsMapping) const
 Get the uniquely generated array of ValueMapping for the elements of OpdsMapping.
 
const ValueMappinggetOperandsMapping (std::initializer_list< const ValueMapping * > OpdsMapping) const
 Get the uniquely generated array of ValueMapping for the given arguments.
 
- Protected Attributes inherited from llvm::RegisterBankInfo
const RegisterBank ** RegBanks
 Hold the set of supported register banks.
 
unsigned NumRegBanks
 Total number of register banks.
 
const unsignedSizes
 Hold the sizes of the register banks for all HwModes.
 
unsigned HwMode
 Current HwMode for the target.
 
DenseMap< hash_code, std::unique_ptr< const PartialMapping > > MapOfPartialMappings
 Keep dynamically allocated PartialMapping in a separate map.
 
DenseMap< hash_code, std::unique_ptr< const ValueMapping > > MapOfValueMappings
 Keep dynamically allocated ValueMapping in a separate map.
 
DenseMap< hash_code, std::unique_ptr< ValueMapping[]> > MapOfOperandsMappings
 Keep dynamically allocated array of ValueMapping in a separate map.
 
DenseMap< hash_code, std::unique_ptr< const InstructionMapping > > MapOfInstructionMappings
 Keep dynamically allocated InstructionMapping in a separate map.
 
DenseMap< unsigned, const TargetRegisterClass * > PhysRegMinimalRCs
 Getting the minimal register class of a physreg is expensive.
 

Detailed Description

Definition at line 26 of file AArch64RegisterBankInfo.h.

Member Enumeration Documentation

◆ PartialMappingIdx

Enumerator
PMI_None 
PMI_FPR16 
PMI_FPR32 
PMI_FPR64 
PMI_FPR128 
PMI_FPR256 
PMI_FPR512 
PMI_GPR32 
PMI_GPR64 
PMI_GPR128 
PMI_FirstGPR 
PMI_LastGPR 
PMI_FirstFPR 
PMI_LastFPR 
PMI_Min 

Definition at line 28 of file AArch64RegisterBankInfo.h.

◆ ValueMappingIdx

Enumerator
InvalidIdx 
First3OpsIdx 
Last3OpsIdx 
DistanceBetweenRegBanks 
FirstCrossRegCpyIdx 
LastCrossRegCpyIdx 
DistanceBetweenCrossRegCpy 
FPExt16To32Idx 
FPExt16To64Idx 
FPExt32To64Idx 
FPExt64To128Idx 
Shift64Imm 

Definition at line 50 of file AArch64RegisterBankInfo.h.

Member Function Documentation

◆ checkPartialMap()

static bool llvm::AArch64GenRegisterBankInfo::checkPartialMap ( unsigned  Idx,
unsigned  ValStartIdx,
unsigned  ValLength,
const RegisterBank RB 
)
staticprotected

◆ checkPartialMappingIdx()

static bool llvm::AArch64GenRegisterBankInfo::checkPartialMappingIdx ( PartialMappingIdx  FirstAlias,
PartialMappingIdx  LastAlias,
ArrayRef< PartialMappingIdx Order 
)
staticprotected

◆ checkValueMapImpl()

static bool llvm::AArch64GenRegisterBankInfo::checkValueMapImpl ( unsigned  Idx,
unsigned  FirstInBank,
unsigned  Size,
unsigned  Offset 
)
staticprotected

◆ getCopyMapping()

static const RegisterBankInfo::ValueMapping * llvm::AArch64GenRegisterBankInfo::getCopyMapping ( unsigned  DstBankID,
unsigned  SrcBankID,
TypeSize  Size 
)
staticprotected

Get the pointer to the ValueMapping of the operands of a copy instruction from the SrcBankID register bank to the DstBankID register bank with a size of Size.

Referenced by llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(), and llvm::AArch64RegisterBankInfo::getInstrMapping().

◆ getFPExtMapping()

static const RegisterBankInfo::ValueMapping * llvm::AArch64GenRegisterBankInfo::getFPExtMapping ( unsigned  DstSize,
unsigned  SrcSize 
)
staticprotected

Get the instruction mapping for G_FPEXT.

Precondition
(DstSize, SrcSize) pair is one of the following: (32, 16), (64, 16), (64, 32), (128, 64)
Returns
An InstructionMapping with statically allocated OperandsMapping.

Referenced by llvm::AArch64RegisterBankInfo::getInstrMapping().

◆ getRegBankBaseIdxOffset()

static unsigned llvm::AArch64GenRegisterBankInfo::getRegBankBaseIdxOffset ( unsigned  RBIdx,
TypeSize  Size 
)
staticprotected

◆ getValueMapping()

static const RegisterBankInfo::ValueMapping * llvm::AArch64GenRegisterBankInfo::getValueMapping ( PartialMappingIdx  RBIdx,
TypeSize  Size 
)
staticprotected

Get the pointer to the ValueMapping representing the RegisterBank at RBIdx with a size of Size.

The returned mapping works for instructions with the same kind of operands for up to 3 operands.

Precondition
RBIdx != PartialMappingIdx::None

Referenced by llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(), and llvm::AArch64RegisterBankInfo::getInstrMapping().

Member Data Documentation

◆ BankIDToCopyMapIdx

const PartialMappingIdx llvm::AArch64GenRegisterBankInfo::BankIDToCopyMapIdx[]
staticprotected

Definition at line 48 of file AArch64RegisterBankInfo.h.

◆ PartMappings

const RegisterBankInfo::PartialMapping llvm::AArch64GenRegisterBankInfo::PartMappings[]
staticprotected

◆ ValMappings

const RegisterBankInfo::ValueMapping llvm::AArch64GenRegisterBankInfo::ValMappings[]
staticprotected

The documentation for this class was generated from the following file: