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());
159 if (
Imm.getLoBits(16).isZero()) {
160 MachineInstr *Inst =
B.buildInstr(Mips::LUi, {DestReg}, {})
161 .addImm(
Imm.getHiBits(16).getLimitedValue());
165 if (
Imm.isSignedIntN(16)) {
167 B.buildInstr(Mips::ADDiu, {DestReg}, {
Register(Mips::ZERO)})
168 .addImm(
Imm.getLoBits(16).getLimitedValue());
172 Register LUiReg =
B.getMRI()->createVirtualRegister(&Mips::GPR32RegClass);
173 MachineInstr *LUi =
B.buildInstr(Mips::LUi, {LUiReg}, {})
174 .addImm(
Imm.getHiBits(16).getLimitedValue());
175 MachineInstr *ORi =
B.buildInstr(Mips::ORi, {DestReg}, {LUiReg})
176 .addImm(
Imm.getLoBits(16).getLimitedValue());
186MipsInstructionSelector::selectLoadStoreOpCode(MachineInstr &
I,
187 MachineRegisterInfo &
MRI)
const {
188 const Register ValueReg =
I.getOperand(0).getReg();
189 const LLT Ty =
MRI.getType(ValueReg);
191 const unsigned MemSizeInBytes =
192 (*
I.memoperands_begin())->getSize().getValue();
193 unsigned Opc =
I.getOpcode();
194 const bool isStore =
Opc == TargetOpcode::G_STORE;
196 if (isRegInGprb(ValueReg,
MRI)) {
198 (Ty.
isPointer() && TySize == 32 && MemSizeInBytes == 4)) &&
199 "Unsupported register bank, LLT, MemSizeInBytes combination");
202 switch (MemSizeInBytes) {
214 switch (MemSizeInBytes) {
218 return Opc == TargetOpcode::G_SEXTLOAD ? Mips::LH : Mips::LHu;
220 return Opc == TargetOpcode::G_SEXTLOAD ? Mips::LB : Mips::LBu;
226 if (isRegInFprb(ValueReg,
MRI)) {
228 assert(((TySize == 32 && MemSizeInBytes == 4) ||
229 (TySize == 64 && MemSizeInBytes == 8)) &&
230 "Unsupported register bank, LLT, MemSizeInBytes combination");
232 if (MemSizeInBytes == 4)
233 return isStore ? Mips::SWC1 : Mips::LWC1;
236 return isStore ? Mips::SDC164 : Mips::LDC164;
237 return isStore ? Mips::SDC1 : Mips::LDC1;
241 assert(STI.
hasMSA() &&
"Vector instructions require target with MSA.");
242 assert((TySize == 128 && MemSizeInBytes == 16) &&
243 "Unsupported register bank, LLT, MemSizeInBytes combination");
246 return isStore ? Mips::ST_B : Mips::LD_B;
248 return isStore ? Mips::ST_H : Mips::LD_H;
250 return isStore ? Mips::ST_W : Mips::LD_W;
252 return isStore ? Mips::ST_D : Mips::LD_D;
262bool MipsInstructionSelector::buildUnalignedStore(
263 MachineInstr &
I,
unsigned Opc, MachineOperand &BaseAddr,
unsigned Offset,
264 MachineMemOperand *MMO)
const {
265 MachineInstr *NewInst =
267 .
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 =
291bool MipsInstructionSelector::select(MachineInstr &
I) {
304 if (
I.getOpcode() == Mips::G_MUL &&
305 isRegInGprb(
I.getOperand(0).getReg(),
MRI)) {
307 .
add(
I.getOperand(0))
308 .
add(
I.getOperand(1))
309 .
add(
I.getOperand(2));
319 if (selectImpl(
I, *CoverageInfo))
322 MachineInstr *
MI =
nullptr;
323 using namespace TargetOpcode;
325 switch (
I.getOpcode()) {
327 Register PseudoMULTuReg =
MRI.createVirtualRegister(&Mips::ACC64RegClass);
328 MachineInstr *PseudoMULTu, *PseudoMove;
330 PseudoMULTu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::PseudoMULTu))
332 .
add(
I.getOperand(1))
333 .
add(
I.getOperand(2));
337 PseudoMove =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::PseudoMFHI))
338 .
addDef(
I.getOperand(0).getReg())
348 .
add(
I.getOperand(0))
349 .
add(
I.getOperand(1))
350 .
add(
I.getOperand(2));
355 I.setDesc(
TII.get(COPY));
358 case G_FRAME_INDEX: {
360 .
add(
I.getOperand(0))
361 .
add(
I.getOperand(1))
369 "Non-power-of-two jump-table entry size not supported.");
371 Register JTIndex =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
372 MachineInstr *SLL =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::SLL))
374 .
addUse(
I.getOperand(2).getReg())
379 Register DestAddress =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
380 MachineInstr *ADDu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::ADDu))
382 .
addUse(
I.getOperand(0).getReg())
387 Register Dest =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
399 Register DestTmp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
401 MachineInstr *ADDu =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::ADDu))
405 ->getGlobalBaseRegForGlobalISel(MF));
421 .
add(
I.getOperand(0));
425 const Register DestReg =
I.getOperand(0).getReg();
427 const TargetRegisterClass *DefRC =
nullptr;
429 DefRC =
TRI.getRegClass(DestReg);
431 DefRC = getRegClassForTypeOnBank(DestReg,
MRI);
433 I.setDesc(
TII.get(TargetOpcode::PHI));
440 auto MMO = *
I.memoperands_begin();
441 MachineOperand
BaseAddr =
I.getOperand(1);
442 int64_t SignedOffset = 0;
450 MachineInstr *Addr =
MRI.getVRegDef(
I.getOperand(1).getReg());
453 if (
Offset->getOpcode() == G_CONSTANT) {
454 APInt OffsetValue =
Offset->getOperand(1).getCImm()->getValue();
466 if (MMO->
getSize() != 4 || !isRegInGprb(
I.getOperand(0).getReg(),
MRI))
469 if (
I.getOpcode() == G_STORE) {
470 if (!buildUnalignedStore(
I, Mips::SWL, BaseAddr, SignedOffset + 3, MMO))
472 if (!buildUnalignedStore(
I, Mips::SWR, BaseAddr, SignedOffset, MMO))
478 if (
I.getOpcode() == G_LOAD) {
479 Register ImplDef =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
482 Register Tmp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
483 if (!buildUnalignedLoad(
I, Mips::LWL, Tmp, BaseAddr, SignedOffset + 3,
486 if (!buildUnalignedLoad(
I, Mips::LWR,
I.getOperand(0).getReg(),
487 BaseAddr, SignedOffset, Tmp, MMO))
496 const unsigned NewOpc = selectLoadStoreOpCode(
I,
MRI);
497 if (NewOpc ==
I.getOpcode())
501 .
add(
I.getOperand(0))
511 Register HILOReg =
MRI.createVirtualRegister(&Mips::ACC64RegClass);
512 bool IsSigned =
I.getOpcode() == G_SREM ||
I.getOpcode() == G_SDIV;
513 bool IsDiv =
I.getOpcode() == G_UDIV ||
I.getOpcode() == G_SDIV;
515 MachineInstr *PseudoDIV, *PseudoMove;
517 TII.get(IsSigned ? Mips::PseudoSDIV : Mips::PseudoUDIV))
519 .
add(
I.getOperand(1))
520 .
add(
I.getOperand(2));
525 TII.get(IsDiv ? Mips::PseudoMFLO : Mips::PseudoMFHI))
526 .
addDef(
I.getOperand(0).getReg())
537 .
add(
I.getOperand(0))
538 .
add(
I.getOperand(2))
539 .
add(
I.getOperand(1))
540 .
add(
I.getOperand(3));
543 case G_UNMERGE_VALUES: {
544 if (
I.getNumOperands() != 3)
549 if (!isRegInFprb(Src,
MRI) ||
550 !(isRegInGprb(
Lo,
MRI) && isRegInGprb(
Hi,
MRI)))
554 STI.
isFP64bit() ? Mips::ExtractElementF64_64 : Mips::ExtractElementF64;
556 MachineInstr *ExtractLo =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
563 MachineInstr *ExtractHi =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
573 case G_IMPLICIT_DEF: {
579 MRI.setRegClass(Dst, getRegClassForTypeOnBank(Dst,
MRI));
583 MachineIRBuilder
B(
I);
584 if (!materialize32BitImm(
I.getOperand(0).getReg(),
585 I.getOperand(1).getCImm()->getValue(),
B))
592 const APFloat &FPimm =
I.getOperand(1).getFPImm()->getValueAPF();
594 unsigned Size =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
597 Register GPRReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
598 MachineIRBuilder
B(
I);
599 if (!materialize32BitImm(GPRReg, APImm,
B))
602 MachineInstrBuilder MTC1 =
603 B.buildInstr(Mips::MTC1, {
I.getOperand(0).getReg()}, {GPRReg});
608 Register GPRRegHigh =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
609 Register GPRRegLow =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
610 MachineIRBuilder
B(
I);
611 if (!materialize32BitImm(GPRRegHigh, APImm.
getHiBits(32).
trunc(32),
B))
616 MachineInstrBuilder PairF64 =
B.buildInstr(
617 STI.
isFP64bit() ? Mips::BuildPairF64_64 : Mips::BuildPairF64,
618 {I.getOperand(0).getReg()}, {GPRRegLow, GPRRegHigh});
627 unsigned Size =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
628 unsigned FABSOpcode =
629 Size == 32 ? Mips::FABS_S
630 : STI.
isFP64bit() ? Mips::FABS_D64 : Mips::FABS_D32;
632 .
add(
I.getOperand(0))
633 .
add(
I.getOperand(1));
637 unsigned FromSize =
MRI.getType(
I.getOperand(1).getReg()).getSizeInBits();
638 unsigned ToSize =
MRI.getType(
I.getOperand(0).getReg()).getSizeInBits();
640 assert((ToSize == 32) &&
"Unsupported integer size for G_FPTOSI");
641 assert((FromSize == 32 || FromSize == 64) &&
642 "Unsupported floating point size for G_FPTOSI");
646 Opcode = Mips::TRUNC_W_S;
648 Opcode = STI.
isFP64bit() ? Mips::TRUNC_W_D64 : Mips::TRUNC_W_D32;
649 Register ResultInFPR =
MRI.createVirtualRegister(&Mips::FGR32RegClass);
650 MachineInstr *Trunc =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Opcode))
652 .
addUse(
I.getOperand(1).getReg());
656 MachineInstr *Move =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::MFC1))
657 .
addDef(
I.getOperand(0).getReg())
665 case G_GLOBAL_VALUE: {
666 const llvm::GlobalValue *GVal =
I.getOperand(1).getGlobal();
668 MachineInstr *LWGOT =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::LW))
669 .
addDef(
I.getOperand(0).getReg())
671 ->getGlobalBaseRegForGlobalISel(MF))
688 Register LWGOTDef =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
691 MachineInstr *ADDiu =
693 .
addDef(
I.getOperand(0).getReg())
701 Register LUiReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
703 MachineInstr *LUi =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(Mips::LUi))
710 MachineInstr *ADDiu =
712 .
addDef(
I.getOperand(0).getReg())
725 .
addDef(
I.getOperand(0).getReg())
727 ->getGlobalBaseRegForGlobalISel(MF))
735 .
addDef(
I.getOperand(0).getReg())
748 if (Opcode == Mips::SLTiu || Opcode == Mips::XORi)
755 Register ICMPReg =
I.getOperand(0).getReg();
756 Register Temp =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
765 Instructions.emplace_back(Mips::SLTiu, ICMPReg, Temp, 1);
769 Instructions.emplace_back(Mips::SLTu, ICMPReg, Mips::ZERO, Temp);
776 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
783 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
790 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
797 Instructions.emplace_back(Mips::XORi, ICMPReg, Temp, 1);
803 MachineIRBuilder
B(
I);
804 for (
const struct Instr &Instruction : Instructions) {
805 MachineInstrBuilder MIB =
B.buildInstr(
806 Instruction.Opcode, {Instruction.Def}, {Instruction.LHS});
821 unsigned MipsFCMPCondCode;
822 bool isLogicallyNegated;
824 I.getOperand(1).getPredicate())) {
868 unsigned MoveOpcode = isLogicallyNegated ? Mips::MOVT_I : Mips::MOVF_I;
870 Register TrueInReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
876 unsigned Size =
MRI.getType(
I.getOperand(2).getReg()).getSizeInBits();
877 unsigned FCMPOpcode =
878 Size == 32 ? Mips::FCMP_S32
879 : STI.
isFP64bit() ? Mips::FCMP_D64 : Mips::FCMP_D32;
881 .
addUse(
I.getOperand(2).getReg())
882 .
addUse(
I.getOperand(3).getReg())
883 .
addImm(MipsFCMPCondCode);
887 MachineInstr *Move =
BuildMI(
MBB,
I,
I.getDebugLoc(),
TII.get(MoveOpcode))
888 .
addDef(
I.getOperand(0).getReg())
903 MipsFunctionInfo *FuncInfo = MF.
getInfo<MipsFunctionInfo>();
906 Register LeaReg =
MRI.createVirtualRegister(&Mips::GPR32RegClass);
907 MachineInstr *LEA_ADDiu =
917 .
addUse(
I.getOperand(0).getReg())
938 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.
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 & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool constrainAllUses(const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI) const
const MachineInstrBuilder & addJumpTableIndex(unsigned Idx, unsigned TargetFlags=0) const
const MachineInstrBuilder & addUse(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register use operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
const MachineInstrBuilder & addDef(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register definition operand.
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 bool 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.