13#ifndef LLVM_LIB_TARGET_MIPS_MIPSREGISTERBANKINFO_H
14#define LLVM_LIB_TARGET_MIPS_MIPSREGISTERBANKINFO_H
18#define GET_REGBANK_DECLARATIONS
19#include "MipsGenRegisterBank.inc"
23class TargetRegisterInfo;
26#define GET_TARGET_REGBANK_CLASS
27#include "MipsGenRegisterBank.inc"
70 AmbiguousWithMergeOrUnmerge
73 bool isAmbiguous_64(InstType InstTy,
unsigned OpSize)
const {
74 if (InstTy == InstType::Ambiguous && OpSize == 64)
79 bool isAmbiguous_32(InstType InstTy,
unsigned OpSize)
const {
80 if (InstTy == InstType::Ambiguous && OpSize == 32)
85 bool isAmbiguous_32or64(InstType InstTy,
unsigned OpSize)
const {
86 if (InstTy == InstType::Ambiguous && (OpSize == 32 || OpSize == 64))
91 bool isAmbiguousWithMergeOrUnmerge_64(InstType InstTy,
92 unsigned OpSize)
const {
93 if (InstTy == InstType::AmbiguousWithMergeOrUnmerge && OpSize == 64)
98 bool isFloatingPoint_32or64(InstType InstTy,
unsigned OpSize)
const {
99 if (InstTy == InstType::FloatingPoint && (OpSize == 32 || OpSize == 64))
104 bool isFloatingPoint_64(InstType InstTy,
unsigned OpSize)
const {
105 if (InstTy == InstType::FloatingPoint && OpSize == 64)
110 bool isInteger_32(InstType InstTy,
unsigned OpSize)
const {
111 if (InstTy == InstType::Integer && OpSize == 32)
116 bool isInteger_64(InstType InstTy,
unsigned OpSize)
const {
117 return InstTy == InstType::Integer && OpSize == 64;
126 class AmbiguousRegDefUseContainer {
153 class TypeInfoForMF {
165 InstType &AmbiguousTy);
170 bool isDefUse, InstType &AmbiguousTy);
184 Types.try_emplace(
MI, InstType::NotDetermined);
193 const InstType &getRecordedTypeForInstr(
const MachineInstr *
MI)
const {
194 assert(wasVisited(
MI) &&
"Instruction was not visited!");
195 return Types.find(
MI)->getSecond();
199 void changeRecordedTypeForInstr(
const MachineInstr *
MI, InstType InstTy) {
200 assert(wasVisited(
MI) &&
"Instruction was not visited!");
201 Types.find(
MI)->getSecond() = InstTy;
207 assert(WaitingQueues.
count(
MI) &&
"Instruction was not visited!");
208 return WaitingQueues.
find(
MI)->getSecond();
214 assert(WaitingQueues.
count(
MI) &&
"Instruction was not visited!");
215 WaitingQueues.
find(
MI)->getSecond().push_back(WaitingForMI);
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Register const TargetRegisterInfo * TRI
void visit(MachineFunction &MF, MachineBasicBlock &Start, std::function< void(MachineBasicBlock *)> op)
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
bool erase(const KeyT &Val)
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
Helper class to build MachineInstr.
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
void applyMappingImpl(MachineIRBuilder &Builder, const OperandsMapper &OpdMapper) const override
Here we have to narrowScalar s64 operands to s32, combine away G_MERGE or G_UNMERGE and erase instruc...
MipsRegisterBankInfo(const TargetRegisterInfo &TRI)
void setRegBank(MachineInstr &MI, MachineRegisterInfo &MRI) const
RegBankSelect determined that s64 operand is better to be split into two s32 operands in gprb.
const InstructionMapping & getInstrMapping(const MachineInstr &MI) const override
Get the mapping of the different operands of MI on the register bank.
Helper class that represents how the value of an instruction may be mapped and what is the related co...
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand...
RegisterBankInfo(const RegisterBank **RegBanks, unsigned NumRegBanks, const unsigned *Sizes, unsigned HwMode)
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op