21#include "llvm/IR/IntrinsicsMips.h"
23#define DEBUG_TYPE "mips-isel"
29#define GET_GLOBALISEL_PREDICATE_BITSET
30#include "MipsGenGlobalISel.inc"
31#undef GET_GLOBALISEL_PREDICATE_BITSET
65#define GET_GLOBALISEL_PREDICATES_DECL
66#include "MipsGenGlobalISel.inc"
67#undef GET_GLOBALISEL_PREDICATES_DECL
69#define GET_GLOBALISEL_TEMPORARIES_DECL
70#include "MipsGenGlobalISel.inc"
71#undef GET_GLOBALISEL_TEMPORARIES_DECL
76#define GET_GLOBALISEL_IMPL
77#include "MipsGenGlobalISel.inc"
78#undef GET_GLOBALISEL_IMPL
80MipsInstructionSelector::MipsInstructionSelector(
83 : TM(TM), STI(STI),
TII(*STI.getInstrInfo()),
TRI(*STI.getRegisterInfo()),
87#include
"MipsGenGlobalISel.inc"
90#include
"MipsGenGlobalISel.inc"
95bool MipsInstructionSelector::isRegInGprb(
Register Reg,
100bool MipsInstructionSelector::isRegInFprb(
Register Reg,
101 MachineRegisterInfo &
MRI)
const {
105bool MipsInstructionSelector::selectCopy(MachineInstr &
I,
106 MachineRegisterInfo &
MRI)
const {
107 Register DstReg =
I.getOperand(0).getReg();
111 const TargetRegisterClass *RC = getRegClassForTypeOnBank(DstReg,
MRI);
120const TargetRegisterClass *MipsInstructionSelector::getRegClassForTypeOnBank(
122 const LLT Ty =
MRI.getType(
Reg);
125 if (isRegInGprb(
Reg,
MRI)) {
127 (TySize == 32 || TySize == 64) &&
128 "Register class not available for LLT, register bank combination");
130 return &Mips::GPR32RegClass;
132 return &Mips::GPR64RegClass;
135 if (isRegInFprb(
Reg,
MRI)) {
137 assert((TySize == 32 || TySize == 64) &&
138 "Register class not available for LLT, register bank combination");
140 return &Mips::FGR32RegClass;
141 return STI.
isFP64bit() ? &Mips::FGR64RegClass : &Mips::AFGR64RegClass;
148bool MipsInstructionSelector::materialize32BitImm(
Register DestReg, APInt Imm,
149 MachineIRBuilder &
B)
const {
150 assert(
Imm.getBitWidth() == 32 &&
"Unsupported immediate size.");
152 if (
Imm.getHiBits(16).isZero()) {
154 B.buildInstr(Mips::ORi, {DestReg}, {
Register(Mips::ZERO)})
155 .addImm(
Imm.getLoBits(16).getLimitedValue());
160 if (
Imm.getLoBits(16).isZero()) {
161 MachineInstr *Inst =
B.buildInstr(Mips::LUi, {DestReg}, {})
162 .addImm(
Imm.getHiBits(16).getLimitedValue());
167 if (
Imm.isSignedIntN(16)) {
169 B.buildInstr(Mips::ADDiu, {DestReg}, {
Register(Mips::ZERO)})
170 .addImm(
Imm.getLoBits(16).getLimitedValue());
175 Register LUiReg =
B.getMRI()->createVirtualRegister(&Mips::GPR32RegClass);
176 MachineInstr *LUi =
B.buildInstr(Mips::LUi, {LUiReg}, {})
177 .addImm(
Imm.getHiBits(16).getLimitedValue());
178 MachineInstr *ORi =
B.buildInstr(Mips::ORi, {DestReg}, {LUiReg})
179 .addImm(
Imm.getLoBits(16).getLimitedValue());
187MipsInstructionSelector::selectLoadStoreOpCode(MachineInstr &
I,
188 MachineRegisterInfo &
MRI)
const {
189 const Register ValueReg =
I.getOperand(0).getReg();
190 const LLT Ty =
MRI.getType(ValueReg);
192 const unsigned MemSizeInBytes =
193 (*
I.memoperands_begin())->getSize().getValue();
194 unsigned Opc =
I.getOpcode();
195 const bool isStore =
Opc == TargetOpcode::G_STORE;
197 if (isRegInGprb(ValueReg,
MRI)) {
199 (Ty.
isPointer() && TySize == 32 && MemSizeInBytes == 4)) &&
200 "Unsupported register bank, LLT, MemSizeInBytes combination");
203 switch (MemSizeInBytes) {
215 switch (MemSizeInBytes) {
219 return Opc == TargetOpcode::G_SEXTLOAD ? Mips::LH : Mips::LHu;
221 return Opc == TargetOpcode::G_SEXTLOAD ? Mips::LB : Mips::LBu;
227 if (isRegInFprb(ValueReg,
MRI)) {
229 assert(((TySize == 32 && MemSizeInBytes == 4) ||
230 (TySize == 64 && MemSizeInBytes == 8)) &&
231 "Unsupported register bank, LLT, MemSizeInBytes combination");
233 if (MemSizeInBytes == 4)
234 return isStore ? Mips::SWC1 : Mips::LWC1;
237 return isStore ? Mips::SDC164 : Mips::LDC164;
238 return isStore ? Mips::SDC1 : Mips::LDC1;
242 assert(STI.
hasMSA() &&
"Vector instructions require target with MSA.");
243 assert((TySize == 128 && MemSizeInBytes == 16) &&
244 "Unsupported register bank, LLT, MemSizeInBytes combination");
247 return isStore ? Mips::ST_B : Mips::LD_B;
249 return isStore ? Mips::ST_H : Mips::LD_H;
251 return isStore ? Mips::ST_W : Mips::LD_W;
253 return isStore ? Mips::ST_D : Mips::LD_D;
263bool MipsInstructionSelector::buildUnalignedStore(
264 MachineInstr &
I,
unsigned Opc, MachineOperand &BaseAddr,
unsigned Offset,
265 MachineMemOperand *MMO)
const {
266 MachineInstr *NewInst =
268 .
add(
I.getOperand(0))
276bool MipsInstructionSelector::buildUnalignedLoad(
277 MachineInstr &
I,
unsigned Opc,
Register Dest, MachineOperand &BaseAddr,
278 unsigned Offset,
Register TiedDest, MachineMemOperand *MMO)
const {
279 MachineInstr *NewInst =
290bool MipsInstructionSelector::select(MachineInstr &
I) {
303 if (
I.getOpcode() == Mips::G_MUL &&
304 isRegInGprb(
I.getOperand(0).getReg(),
MRI)) {
306 .
add(
I.getOperand(0))
307 .
add(
I.getOperand(1))
308 .
add(
I.getOperand(2));
317 if (selectImpl(
I, *CoverageInfo))
320 MachineInstr *
MI =
nullptr;
321 using namespace TargetOpcode;
323 switch (
I.getOpcode()) {
325 Register PseudoMULTuReg =
MRI.createVirtualRegister(&Mips::ACC64RegClass);
326 MachineInstr *PseudoMULTu, *PseudoMove;
328 PseudoMULTu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::PseudoMULTu))
330 .
add(
I.getOperand(1))
331 .
add(
I.getOperand(2));
334 PseudoMove =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::PseudoMFHI))
335 .
addDef(
I.getOperand(0).getReg())
344 .
add(
I.getOperand(0))
345 .
add(
I.getOperand(1))
346 .
add(
I.getOperand(2));
351 I.setDesc(
TII.get(COPY));
354 case G_FRAME_INDEX: {
356 .
add(
I.getOperand(0))
357 .
add(
I.getOperand(1))
365 "Non-power-of-two jump-table entry size not supported.");
367 Register JTIndex =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
368 MachineInstr *SLL =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::SLL))
370 .
addUse(
I.getOperand(2).getReg())
374 Register DestAddress =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
375 MachineInstr *ADDu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::ADDu))
377 .
addUse(
I.getOperand(0).getReg())
381 Register Dest =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
392 Register DestTmp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
394 MachineInstr *ADDu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::ADDu))
398 ->getGlobalBaseRegForGlobalISel(MF));
412 .
add(
I.getOperand(0));
416 const Register DestReg =
I.getOperand(0).getReg();
418 const TargetRegisterClass *DefRC =
nullptr;
420 DefRC =
TRI.getRegClass(DestReg);
422 DefRC = getRegClassForTypeOnBank(DestReg,
MRI);
424 I.setDesc(
TII.get(TargetOpcode::PHI));
431 auto MMO = *
I.memoperands_begin();
432 MachineOperand
BaseAddr =
I.getOperand(1);
433 int64_t SignedOffset = 0;
441 MachineInstr *Addr =
MRI.getVRegDef(
I.getOperand(1).getReg());
444 if (
Offset->getOpcode() == G_CONSTANT) {
445 APInt OffsetValue =
Offset->getOperand(1).getCImm()->getValue();
457 if (MMO->
getSize() != 4 || !isRegInGprb(
I.getOperand(0).getReg(),
MRI))
460 if (
I.getOpcode() == G_STORE) {
461 if (!buildUnalignedStore(
I, Mips::SWL, BaseAddr, SignedOffset + 3, MMO))
463 if (!buildUnalignedStore(
I, Mips::SWR, BaseAddr, SignedOffset, MMO))
469 if (
I.getOpcode() == G_LOAD) {
470 Register ImplDef =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
473 Register Tmp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
474 if (!buildUnalignedLoad(
I, Mips::LWL, Tmp, BaseAddr, SignedOffset + 3,
477 if (!buildUnalignedLoad(
I, Mips::LWR,
I.getOperand(0).getReg(),
478 BaseAddr, SignedOffset, Tmp, MMO))
487 const unsigned NewOpc = selectLoadStoreOpCode(
I,
MRI);
488 if (NewOpc ==
I.getOpcode())
492 .
add(
I.getOperand(0))
502 Register HILOReg =
MRI.createVirtualRegister(&Mips::ACC64RegClass);
503 bool IsSigned =
I.getOpcode() == G_SREM ||
I.getOpcode() == G_SDIV;
504 bool IsDiv =
I.getOpcode() == G_UDIV ||
I.getOpcode() == G_SDIV;
506 MachineInstr *PseudoDIV, *PseudoMove;
508 TII.get(IsSigned ? Mips::PseudoSDIV : Mips::PseudoUDIV))
510 .
add(
I.getOperand(1))
511 .
add(
I.getOperand(2));
515 TII.get(IsDiv ? Mips::PseudoMFLO : Mips::PseudoMFHI))
516 .
addDef(
I.getOperand(0).getReg())
526 .
add(
I.getOperand(0))
527 .
add(
I.getOperand(2))
528 .
add(
I.getOperand(1))
529 .
add(
I.getOperand(3));
532 case G_UNMERGE_VALUES: {
533 if (
I.getNumOperands() != 3)
538 if (!isRegInFprb(Src,
MRI) ||
539 !(isRegInGprb(
Lo,
MRI) && isRegInGprb(
Hi,
MRI)))
543 STI.
isFP64bit() ? Mips::ExtractElementF64_64 : Mips::ExtractElementF64;
545 MachineInstr *ExtractLo =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
551 MachineInstr *ExtractHi =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
560 case G_IMPLICIT_DEF: {
566 MRI.setRegClass(Dst, getRegClassForTypeOnBank(Dst,
MRI));
570 MachineIRBuilder
B(
I);
571 if (!materialize32BitImm(
I.getOperand(0).getReg(),
572 I.getOperand(1).getCImm()->getValue(),
B))
579 const APFloat &FPimm =
I.getOperand(1).getFPImm()->getValueAPF();
581 unsigned Size =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
584 Register GPRReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
585 MachineIRBuilder
B(
I);
586 if (!materialize32BitImm(GPRReg, APImm,
B))
589 MachineInstrBuilder MTC1 =
590 B.buildInstr(Mips::MTC1, {
I.getOperand(0).getReg()}, {GPRReg});
594 Register GPRRegHigh =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
595 Register GPRRegLow =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
596 MachineIRBuilder
B(
I);
597 if (!materialize32BitImm(GPRRegHigh, APImm.
getHiBits(32).
trunc(32),
B))
602 MachineInstrBuilder PairF64 =
B.buildInstr(
603 STI.
isFP64bit() ? Mips::BuildPairF64_64 : Mips::BuildPairF64,
604 {I.getOperand(0).getReg()}, {GPRRegLow, GPRRegHigh});
612 unsigned Size =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
613 unsigned FABSOpcode =
614 Size == 32 ? Mips::FABS_S
615 : STI.
isFP64bit() ? Mips::FABS_D64 : Mips::FABS_D32;
617 .
add(
I.getOperand(0))
618 .
add(
I.getOperand(1));
622 unsigned FromSize =
MRI.getType(
I.getOperand(1).getReg()).getSizeInBits();
623 unsigned ToSize =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
625 assert((ToSize == 32) &&
"Unsupported integer size for G_FPTOSI");
626 assert((FromSize == 32 || FromSize == 64) &&
627 "Unsupported floating point size for G_FPTOSI");
631 Opcode = Mips::TRUNC_W_S;
633 Opcode = STI.
isFP64bit() ? Mips::TRUNC_W_D64 : Mips::TRUNC_W_D32;
634 Register ResultInFPR =
MRI.createVirtualRegister(&Mips::FGR32RegClass);
635 MachineInstr *Trunc =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
637 .
addUse(
I.getOperand(1).getReg());
640 MachineInstr *Move =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::MFC1))
641 .
addDef(
I.getOperand(0).getReg())
648 case G_GLOBAL_VALUE: {
649 const llvm::GlobalValue *GVal =
I.getOperand(1).getGlobal();
651 MachineInstr *LWGOT =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::LW))
652 .
addDef(
I.getOperand(0).getReg())
654 ->getGlobalBaseRegForGlobalISel(MF))
670 Register LWGOTDef =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
673 MachineInstr *ADDiu =
675 .
addDef(
I.getOperand(0).getReg())
682 Register LUiReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
684 MachineInstr *LUi =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::LUi))
690 MachineInstr *ADDiu =
692 .
addDef(
I.getOperand(0).getReg())
704 .
addDef(
I.getOperand(0).getReg())
706 ->getGlobalBaseRegForGlobalISel(MF))
714 .
addDef(
I.getOperand(0).getReg())
727 if (Opcode == Mips::SLTiu || Opcode == Mips::XORi)
734 Register ICMPReg =
I.getOperand(0).getReg();
735 Register Temp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
744 Instructions.emplace_back(Mips::SLTiu, ICMPReg, Temp, 1);
748 Instructions.emplace_back(Mips::SLTu, ICMPReg, Mips::ZERO, Temp);
755 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
762 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
769 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
776 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
782 MachineIRBuilder
B(
I);
783 for (
const struct Instr &Instruction : Instructions) {
784 MachineInstrBuilder MIB =
B.buildInstr(
785 Instruction.Opcode, {Instruction.Def}, {Instruction.LHS});
799 unsigned MipsFCMPCondCode;
800 bool isLogicallyNegated;
802 I.getOperand(1).getPredicate())) {
846 unsigned MoveOpcode = isLogicallyNegated ? Mips::MOVT_I : Mips::MOVF_I;
848 Register TrueInReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
854 unsigned Size =
MRI.getType(
I.getOperand(2).getReg()).getSizeInBits();
855 unsigned FCMPOpcode =
856 Size == 32 ? Mips::FCMP_S32
857 : STI.
isFP64bit() ? Mips::FCMP_D64 : Mips::FCMP_D32;
859 .
addUse(
I.getOperand(2).getReg())
860 .
addUse(
I.getOperand(3).getReg())
861 .
addImm(MipsFCMPCondCode);
864 MachineInstr *Move =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(MoveOpcode))
865 .
addDef(
I.getOperand(0).getReg())
879 MipsFunctionInfo *FuncInfo = MF.
getInfo<MipsFunctionInfo>();
882 Register LeaReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
883 MachineInstr *LEA_ADDiu =
892 .
addUse(
I.getOperand(0).getReg())
913 return new MipsInstructionSelector(TM, Subtarget, RBI);
unsigned const MachineRegisterInfo * MRI
#define GET_GLOBALISEL_PREDICATES_INIT
#define GET_GLOBALISEL_TEMPORARIES_INIT
static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isStore(int Opcode)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const HexagonInstrInfo * TII
This file declares the MachineIRBuilder class.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
This file declares the targeting of the RegisterBankInfo class for Mips.
static StringRef getName(Value *V)
const SmallVectorImpl< MachineOperand > & Cond
APInt bitcastToAPInt() const
Class for arbitrary precision integers.
LLVM_ABI APInt getLoBits(unsigned numBits) const
Compute an APInt containing numBits lowbits from this APInt.
LLVM_ABI APInt getHiBits(unsigned numBits) const
Compute an APInt containing numBits highbits from this APInt.
LLVM_ABI APInt trunc(unsigned width) const
Truncate to new width.
bool isSignedIntN(unsigned N) const
Check if this APInt has an N-bits signed integer value.
int64_t getSExtValue() const
Get sign extended value.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ FCMP_OEQ
0 0 0 1 True if ordered and equal
@ ICMP_SLT
signed less than
@ ICMP_SLE
signed less or equal
@ FCMP_OLT
0 1 0 0 True if ordered and less than
@ FCMP_ULE
1 1 0 1 True if unordered, less than, or equal
@ FCMP_OGT
0 0 1 0 True if ordered and greater than
@ FCMP_OGE
0 0 1 1 True if ordered and greater than or equal
@ ICMP_UGE
unsigned greater or equal
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ FCMP_ULT
1 1 0 0 True if unordered or less than
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
@ ICMP_ULT
unsigned less than
@ FCMP_UGT
1 0 1 0 True if unordered or greater than
@ FCMP_OLE
0 1 0 1 True if ordered and less than or equal
@ FCMP_ORD
0 1 1 1 True if ordered (no nans)
@ ICMP_SGE
signed greater or equal
@ FCMP_UNE
1 1 1 0 True if unordered or not equal
@ ICMP_ULE
unsigned less or equal
@ FCMP_UGE
1 0 1 1 True if unordered, greater than, or equal
@ FCMP_UNO
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
bool hasLocalLinkage() const
constexpr bool isScalar() const
constexpr bool isVector() const
constexpr TypeSize getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
constexpr bool isPointer() const
constexpr LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
TypeSize getValue() const
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Helper class to build MachineInstr.
void constrainAllUses(const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI) const
const MachineInstrBuilder & addUse(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register use operand.
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addFrameIndex(int Idx) const
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const
const MachineInstrBuilder & addJumpTableIndex(unsigned Idx, unsigned TargetFlags=0) const
const MachineInstrBuilder & addDef(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register definition operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
LLVM_ABI void addMemOperand(MachineFunction &MF, MachineMemOperand *MO)
Add a MachineMemOperand to the machine instruction.
LLVM_ABI unsigned getEntrySize(const DataLayout &TD) const
getEntrySize - Return the size of each entry in the jump table.
A description of a memory reference used in the backend.
LocationSize getSize() const
Return the size in bytes of the memory reference.
@ MOLoad
The memory access reads data.
LLVM_ABI Align getAlign() const
Return the minimum known alignment in bytes of the actual memory reference.
MachineOperand class - Representation of each machine instruction operand.
LLVM_ABI void setReg(Register Reg)
Change the register this operand corresponds to.
Register getReg() const
getReg - Returns the register number.
void setTargetFlags(unsigned F)
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
int getVarArgsFrameIndex() const
This class provides the information for the target register banks.
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
static const TargetRegisterClass * constrainGenericRegister(Register Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI)
Constrain the (possibly generic) virtual register Reg to RC.
const RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
unsigned getID() const
Get the identifier of this register bank.
Wrapper class representing virtual and physical registers.
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
bool isPositionIndependent() const
Value * getOperand(unsigned i) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Predicate getPredicate(unsigned Condition, unsigned Hint)
Return predicate consisting of specified condition and hint bits.
bool hasImm(uint64_t TSFlags)
NodeAddr< DefNode * > Def
NodeAddr< InstrNode * > Instr
friend class Instruction
Iterator for Instructions in a `BasicBlock.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
LLVM_ABI void constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
bool isPreISelGenericOpcode(unsigned Opcode)
Check whether the given Opcode is a generic opcode that is not supposed to appear after ISel.
InstructionSelector * createMipsInstructionSelector(const MipsTargetMachine &, const MipsSubtarget &, const MipsRegisterBankInfo &)
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
static LLVM_ABI MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.