22 #define GET_TARGET_REGBANK_IMPL
23 #include "ARMGenRegisterBank.inc"
27 #ifndef LLVM_BUILD_GLOBAL_ISEL
28 #error "You shouldn't build this"
54 unsigned Start,
unsigned Length,
63 "Wrong mapping for GPR");
66 "Wrong mapping for SPR");
69 "Wrong mapping for DPR");
105 "Wrong value mapping for 3 GPR ops instruction");
108 "Wrong value mapping for 3 GPR ops instruction");
111 "Wrong value mapping for 3 GPR ops instruction");
115 "Wrong value mapping for 3 SPR ops instruction");
118 "Wrong value mapping for 3 SPR ops instruction");
121 "Wrong value mapping for 3 SPR ops instruction");
125 "Wrong value mapping for 3 DPR ops instruction");
128 "Wrong value mapping for 3 DPR ops instruction");
131 "Wrong value mapping for 3 DPR ops instruction");
139 static bool AlreadyInit =
false;
151 assert(&ARM::GPRRegBank == &RBGPR &&
"The order in RegBanks is messed up");
155 "Subclass not added?");
157 "Subclass not added?");
159 "Subclass not added?");
161 "Subclass not added?");
163 "Subclass not added?");
165 "Subclass not added?");
167 "Subclass not added?");
168 assert(RBGPR.
getSize() == 32 &&
"GPRs should hold up to 32-bit");
180 switch (RC.
getID()) {
182 case GPRnopcRegClassID:
183 case GPRspRegClassID:
184 case tGPR_and_tcGPRRegClassID:
187 case SPR_8RegClassID:
189 case DPR_8RegClassID:
211 using namespace TargetOpcode;
249 "Unsupported size for G_FADD");
292 "Mismatched operand sizes for G_FCMP");
295 assert((Size == 32 || Size == 64) &&
"Unsupported size for G_FCMP");
301 FPRValueMapping, FPRValueMapping});
304 case G_MERGE_VALUES: {
319 case G_UNMERGE_VALUES: {
346 for (
unsigned i = 0; i < NumOperands; i++) {
347 for (
const auto &Mapping : OperandsMapping[i]) {
349 (Mapping.RegBank->getID() != ARM::FPRRegBankID ||
351 "Trying to use floating point register bank on target without vfp");
static bool checkValueMapping(const RegisterBankInfo::ValueMapping &VM, RegisterBankInfo::PartialMapping *BreakDown)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const InstructionMapping & getInvalidInstructionMapping() const
Method to get a uniquely generated invalid InstructionMapping.
const InstructionMapping & getInstructionMapping(unsigned ID, unsigned Cost, const ValueMapping *OperandsMapping, unsigned NumOperands) const
Method to get a uniquely generated InstructionMapping.
Helper class that represents how the value of an instruction may be mapped and what is the related co...
unsigned getID() const
Return the register class ID number.
setjmp/longjmp based exceptions
static void checkValueMappings()
const PartialMapping * BreakDown
How the value is broken down between the different register banks.
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
unsigned StartIdx
Number of bits at which this partial mapping starts in the original value.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
const ValueMapping * getOperandsMapping(Iterator Begin, Iterator End) const
Get the uniquely generated array of ValueMapping for the elements of between Begin and End...
RegisterBankInfo::PartialMapping static bool checkPartMapping(const RegisterBankInfo::PartialMapping &PM, unsigned Start, unsigned Length, unsigned RegBankID)
const RegisterBank * RegBank
Register bank where the partial value lives.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineBasicBlock * getParent() const
unsigned const MachineRegisterInfo * MRI
This file declares the targeting of the RegisterBankInfo class for ARM.
RegisterBankInfo::ValueMapping ValueMappings[]
const MachineOperand & getOperand(unsigned i) const
unsigned getID() const
Get the identifier of this register bank.
Helper struct that represents how a value is partially mapped into a register.
unsigned Length
Length of this mapping in bits.
static const unsigned DefaultMappingID
Identifier used when the related instruction mapping instance is generated by target independent code...
RegisterBankInfo::PartialMapping PartMappings[]
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
ARMRegisterBankInfo(const TargetRegisterInfo &TRI)
static void checkPartialMappings()
RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
This class implements the register bank concept.
Helper struct that represents how a value is mapped through different register banks.
static bool isPreISelGenericOpcode(unsigned Opcode)
Check whether the given Opcode is a generic opcode that is not supposed to appear after ISel...
bool isValid() const
Check whether this object is valid.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
const RegisterBank & getRegBankFromRegClass(const TargetRegisterClass &RC) const override
Get a register bank that covers RC.
unsigned getSize() const
Get the maximal size in bits that fits in this register bank.
const InstructionMapping & getInstrMapping(const MachineInstr &MI) const override
Get the mapping of the different operands of MI on the register bank.
bool covers(const TargetRegisterClass &RC) const
Check whether this register bank covers RC.
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const InstructionMapping & getInstrMappingImpl(const MachineInstr &MI) const
Try to get the mapping of MI.
unsigned NumBreakDowns
Number of partial mapping to break down this value.
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.