36#define GET_INSTRINFO_CTOR_DTOR
37#include "MipsGenInstrInfo.inc"
40void MipsInstrInfo::anchor() {}
49 return Subtarget.getABI().ArePtrs64bit() ? &Mips::GPR64RegClass
50 : &Mips::GPR32RegClass;
61 return op.isImm() &&
op.getImm() == 0;
84 "insertNop does not support MIPS16e mode at this time");
85 const unsigned MMOpc =
86 Subtarget.hasMips32r6() ? Mips::SLL_MMR6 : Mips::SLL_MM;
109void MipsInstrInfo::AnalyzeCondBr(
const MachineInstr *Inst,
unsigned Opc,
112 assert(getAnalyzableBrOpc(
Opc) &&
"Not an analyzable branch");
120 for (
int i = 0; i < NumOp-1; i++)
128 bool AllowModify)
const {
138 unsigned Opc =
Cond[0].getImm();
142 for (
unsigned i = 1; i <
Cond.size(); ++i) {
144 "Cannot copy operand for conditional branch!");
156 int *BytesAdded)
const {
158 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
159 assert(!BytesAdded &&
"code size not handled");
167 "# of Mips branch conditions must be <= 3!");
192 int *BytesRemoved)
const {
193 assert(!BytesRemoved &&
"code size not handled");
196 unsigned removed = 0;
200 while (
I != REnd && removed < 2) {
202 if (
I->isDebugInstr()) {
206 if (!getAnalyzableBrOpc(
I->getOpcode()))
209 I->eraseFromParent();
222 "Invalid Mips branch condition!");
234 while (
I != REnd &&
I->isDebugInstr())
237 if (
I == REnd || !isUnpredicatedTerminator(*
I)) {
245 unsigned LastOpc = LastInst->
getOpcode();
249 if (!getAnalyzableBrOpc(LastOpc))
253 unsigned SecondLastOpc = 0;
259 while (
I != REnd &&
I->isDebugInstr())
263 SecondLastInst = &*
I;
264 SecondLastOpc = getAnalyzableBrOpc(SecondLastInst->
getOpcode());
267 if (isUnpredicatedTerminator(*SecondLastInst) && !SecondLastOpc)
272 if (!SecondLastOpc) {
280 AnalyzeCondBr(LastInst, LastOpc,
TBB,
Cond);
286 if (++
I != REnd && isUnpredicatedTerminator(*
I))
289 BranchInstrs.
insert(BranchInstrs.
begin(), SecondLastInst);
309 AnalyzeCondBr(SecondLastInst, SecondLastOpc,
TBB,
Cond);
316 int64_t BrOffset)
const {
321 case Mips::BAL_BR_MM:
326 case Mips::BEQ:
case Mips::BEQ64:
328 case Mips::BGEZ:
case Mips::BGEZ64:
332 case Mips::BGTZ:
case Mips::BGTZ64:
334 case Mips::BLEZ:
case Mips::BLEZ64:
336 case Mips::BLTZ:
case Mips::BLTZ64:
340 case Mips::BNE:
case Mips::BNE64:
350 case Mips::BGEZAL_MM:
354 case Mips::BLTZAL_MM:
364 case Mips::BEQZ16_MM:
365 case Mips::BNEZ16_MM:
377 case Mips::BEQC:
case Mips::BEQC64:
378 case Mips::BNEC:
case Mips::BNEC64:
379 case Mips::BGEC:
case Mips::BGEC64:
380 case Mips::BGEUC:
case Mips::BGEUC64:
381 case Mips::BGEZC:
case Mips::BGEZC64:
382 case Mips::BGTZC:
case Mips::BGTZC64:
383 case Mips::BLEZC:
case Mips::BLEZC64:
384 case Mips::BLTC:
case Mips::BLTC64:
385 case Mips::BLTUC:
case Mips::BLTUC64:
386 case Mips::BLTZC:
case Mips::BLTZC64:
397 case Mips::BEQZC:
case Mips::BEQZC64:
398 case Mips::BNEZC:
case Mips::BNEZC64:
402 case Mips::BC16_MMR6:
405 case Mips::BEQZC16_MMR6:
406 case Mips::BNEZC16_MMR6:
409 case Mips::BALC_MMR6:
413 case Mips::BC1EQZC_MMR6:
414 case Mips::BC1NEZC_MMR6:
415 case Mips::BC2EQZC_MMR6:
416 case Mips::BC2NEZC_MMR6:
417 case Mips::BGEZALC_MMR6:
418 case Mips::BEQZALC_MMR6:
419 case Mips::BGTZALC_MMR6:
420 case Mips::BLEZALC_MMR6:
421 case Mips::BLTZALC_MMR6:
422 case Mips::BNEZALC_MMR6:
423 case Mips::BNVC_MMR6:
424 case Mips::BOVC_MMR6:
427 case Mips::BEQC_MMR6:
428 case Mips::BNEC_MMR6:
429 case Mips::BGEC_MMR6:
430 case Mips::BGEUC_MMR6:
431 case Mips::BGEZC_MMR6:
432 case Mips::BGTZC_MMR6:
433 case Mips::BLEZC_MMR6:
434 case Mips::BLTC_MMR6:
435 case Mips::BLTUC_MMR6:
436 case Mips::BLTZC_MMR6:
439 case Mips::BEQZC_MMR6:
440 case Mips::BNEZC_MMR6:
446 case Mips::BPOSGE32_MM:
447 case Mips::BPOSGE32C_MMR3:
477 unsigned Opcode =
I->getOpcode();
478 bool canUseShortMicroMipsCTI =
false;
488 if (
I->getOperand(1).getReg() ==
Subtarget.getABI().GetZeroReg())
489 canUseShortMicroMipsCTI =
true;
494 case Mips::PseudoReturn:
495 case Mips::PseudoIndirectBranch:
496 canUseShortMicroMipsCTI =
true;
502 if (
Subtarget.hasMips32r6() && (
I->getNumOperands() > 1) &&
503 (
I->getOperand(0).isReg() &&
504 (
I->getOperand(0).getReg() == Mips::ZERO ||
505 I->getOperand(0).getReg() == Mips::ZERO_64)) &&
506 (
I->getOperand(1).isReg() &&
507 (
I->getOperand(1).getReg() == Mips::ZERO ||
508 I->getOperand(1).getReg() == Mips::ZERO_64)))
511 if (
Subtarget.hasMips32r6() || canUseShortMicroMipsCTI) {
519 if (canUseShortMicroMipsCTI)
520 return Mips::BEQZC_MM;
521 else if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
526 if (canUseShortMicroMipsCTI)
527 return Mips::BNEZC_MM;
528 else if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
532 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
536 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
546 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
550 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
556 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
560 if (
I->getOperand(0).getReg() ==
I->getOperand(1).getReg())
564 return Mips::BGTZC64;
566 return Mips::BGEZC64;
568 return Mips::BLTZC64;
570 return Mips::BLEZC64;
574 case Mips::PseudoIndirectBranchR6:
575 case Mips::PseudoReturn:
576 case Mips::TAILCALLR6REG:
577 if (canUseShortMicroMipsCTI)
578 return Mips::JRC16_MM;
580 case Mips::JALRPseudo:
583 case Mips::PseudoIndirectBranch64R6:
584 case Mips::PseudoReturn64:
585 case Mips::TAILCALL64R6REG:
587 case Mips::JALR64Pseudo:
588 return Mips::JIALC64;
608 if (
MI.isInlineAsm())
652 return Op.isReg() && MIInSlot.readsRegister(Op.getReg(), nullptr) &&
653 !MIInSlot.hasRegisterImplicitUseOperand(Op.getReg());
671 switch (
MI.getOpcode()) {
690 switch (
MI.getOpcode()) {
707 const unsigned Opcode =
MI.getOpcode();
714 return ((
MI.getOperand(2).isImm() &&
MI.getOperand(2).getImm() == 0) ||
715 (
MI.getOperand(1).isReg() &&
716 (
MI.getOperand(1).getReg() == Mips::ZERO ||
717 MI.getOperand(1).getReg() == Mips::ZERO_64)));
719 return MI.isAsCheapAsAMove();
724 switch (
MI.getOpcode()) {
727 if (
MI.isBundledWithSucc())
728 return MI.getDesc().getSize() + getInstBundleSize(
MI);
729 if (
MI.hasDelaySlot()) {
731 return MI.getDesc().getSize() + 4;
733 return MI.getDesc().getSize();
734 case TargetOpcode::INLINEASM:
735 case TargetOpcode::INLINEASM_BR: {
737 const char *AsmStr =
MI.getOperand(0).getSymbolName();
740 case TargetOpcode::BUNDLE:
741 return getInstBundleSize(
MI);
742 case TargetOpcode::PATCHABLE_FUNCTION_ENTER:
743 case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
744 case TargetOpcode::PATCHABLE_TAIL_CALL:
753 case Mips::CONSTPOOL_ENTRY:
756 return MI.getOperand(2).getImm();
774 int ZeroOperandPosition = -1;
775 bool BranchWithZeroOperand =
false;
776 if (
I->isBranch() && !
I->isPseudo()) {
777 auto TRI =
I->getParent()->getParent()->getSubtarget().getRegisterInfo();
778 ZeroOperandPosition =
I->findRegisterUseOperandIdx(Mips::ZERO,
TRI,
false);
779 BranchWithZeroOperand = ZeroOperandPosition != -1;
782 if (BranchWithZeroOperand) {
785 NewOpc = Mips::BEQZC;
788 NewOpc = Mips::BNEZC;
791 NewOpc = Mips::BGEZC;
794 NewOpc = Mips::BLTZC;
797 NewOpc = Mips::BEQZC64;
800 NewOpc = Mips::BNEZC64;
805 MIB =
BuildMI(*
I->getParent(),
I,
I->getDebugLoc(),
get(NewOpc));
811 if (NewOpc == Mips::JIC || NewOpc == Mips::JIALC || NewOpc == Mips::JIC64 ||
812 NewOpc == Mips::JIALC64) {
814 if (NewOpc == Mips::JIALC || NewOpc == Mips::JIALC64)
817 for (
unsigned J = 0, E =
I->getDesc().getNumOperands(); J < E; ++J) {
818 MIB.
add(
I->getOperand(J));
825 for (
unsigned J =
I->getDesc().getNumOperands(), E =
I->getNumOperands();
834 for (
unsigned J = 0, E =
I->getDesc().getNumOperands(); J < E; ++J) {
835 if (BranchWithZeroOperand && (
unsigned)ZeroOperandPosition == J)
838 MIB.
add(
I->getOperand(J));
849 unsigned &SrcOpIdx2)
const {
851 "TargetInstrInfo::findCommutedOpIndices() can't handle bundles");
854 if (!
MCID.isCommutable())
857 switch (
MI.getOpcode()) {
858 case Mips::DPADD_U_H:
859 case Mips::DPADD_U_W:
860 case Mips::DPADD_U_D:
861 case Mips::DPADD_S_H:
862 case Mips::DPADD_S_W:
863 case Mips::DPADD_S_D:
865 if (!fixCommutedOpIndices(SrcOpIdx1, SrcOpIdx2, 2, 3))
868 if (!
MI.getOperand(SrcOpIdx1).isReg() || !
MI.getOperand(SrcOpIdx2).isReg())
890 const int64_t PosLow,
const int64_t PosHigh,
891 const int64_t SizeLow,
892 const int64_t SizeHigh,
893 const int64_t BothLow,
894 const int64_t BothHigh) {
896 if (!MOPos.
isImm()) {
897 ErrInfo =
"Position is not an immediate!";
900 int64_t Pos = MOPos.
getImm();
901 if (!((PosLow <= Pos) && (Pos < PosHigh))) {
902 ErrInfo =
"Position operand is out of range!";
907 if (!MOSize.
isImm()) {
908 ErrInfo =
"Size operand is not an immediate!";
912 if (!((SizeLow <
Size) && (
Size <= SizeHigh))) {
913 ErrInfo =
"Size operand is out of range!";
917 if (!((BothLow < (Pos +
Size)) && ((Pos +
Size) <= BothHigh))) {
918 ErrInfo =
"Position + Size is out of range!";
929 switch (
MI.getOpcode()) {
955 case Mips::TAILCALLREG:
956 case Mips::PseudoIndirectBranch:
961 case Mips::JALRPseudo:
965 ErrInfo =
"invalid instruction when using jump guards!";
974std::pair<unsigned, unsigned>
976 return std::make_pair(TF, 0u);
983 static const std::pair<unsigned, const char*> Flags[] = {
984 {MO_GOT,
"mips-got"},
985 {MO_GOT_CALL,
"mips-got-call"},
986 {MO_GPREL,
"mips-gprel"},
987 {MO_ABS_HI,
"mips-abs-hi"},
988 {MO_ABS_LO,
"mips-abs-lo"},
989 {MO_TLSGD,
"mips-tlsgd"},
990 {MO_TLSLDM,
"mips-tlsldm"},
991 {MO_DTPREL_HI,
"mips-dtprel-hi"},
992 {MO_DTPREL_LO,
"mips-dtprel-lo"},
993 {MO_GOTTPREL,
"mips-gottprel"},
994 {MO_TPREL_HI,
"mips-tprel-hi"},
995 {MO_TPREL_LO,
"mips-tprel-lo"},
996 {MO_GPOFF_HI,
"mips-gpoff-hi"},
997 {MO_GPOFF_LO,
"mips-gpoff-lo"},
998 {MO_GOT_DISP,
"mips-got-disp"},
999 {MO_GOT_PAGE,
"mips-got-page"},
1000 {MO_GOT_OFST,
"mips-got-ofst"},
1001 {MO_HIGHER,
"mips-higher"},
1002 {MO_HIGHEST,
"mips-highest"},
1003 {MO_GOT_HI16,
"mips-got-hi16"},
1004 {MO_GOT_LO16,
"mips-got-lo16"},
1005 {MO_CALL_HI16,
"mips-call-hi16"},
1006 {MO_CALL_LO16,
"mips-call-lo16"},
1007 {MO_JALR,
"mips-jalr"}
1012std::optional<ParamLoadedValue>
1020 int64_t
Offset = RegImm->Imm;
1023 if (SrcReg == Mips::ZERO || SrcReg == Mips::ZERO_64) {
1028 }
else if (
auto DestSrc = isCopyInstr(
MI)) {
1031 Register DestReg = DestSrc->Destination->getReg();
1034 if (
TRI->isSuperRegister(Reg, DestReg) ||
TRI->isSubRegister(Reg, DestReg))
1035 return std::nullopt;
1047 return std::nullopt;
1049 switch (
MI.getOpcode()) {
1051 case Mips::DADDiu: {
1062 return std::nullopt;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
Register const TargetRegisterInfo * TRI
static bool isReg(const MCInst &MI, unsigned OpNo)
static bool verifyInsExtInstruction(const MachineInstr &MI, StringRef &ErrInfo, const int64_t PosLow, const int64_t PosHigh, const int64_t SizeLow, const int64_t SizeHigh, const int64_t BothLow, const int64_t BothHigh)
#define IsMFLOMFHI(instr)
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
static LLVM_ABI DIExpression * prepend(const DIExpression *Expr, uint8_t Flags, int64_t Offset=0)
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value or/and an ...
MCInstBuilder & addReg(MCRegister Reg)
Add a new register operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
MachineInstrBundleIterator< MachineInstr > iterator
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, LLT MemTy, Align BaseAlignment, const MMOMetadata &Metadata=MMOMetadata(), SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
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 & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) const
const MachineInstrBuilder & copyImplicitOps(const MachineInstr &OtherMI) const
Copy all the implicit operands from OtherMI onto this one.
Representation of each machine instruction.
mop_range defs()
Returns all explicit operands that are register definitions.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
LLVM_ABI std::pair< bool, bool > readsWritesVirtualRegister(Register Reg, SmallVectorImpl< unsigned > *Ops=nullptr) const
Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg.
LLVM_ABI unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
bool isUnconditionalBranch(QueryType Type=AnyInBundle) const
Return true if this is a branch which always transfers control flow to some other block.
void setImplicitPhysRegDefsDead()
Mark the implicit physreg defs named by the instruction description as dead.
LLVM_ABI void removeOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with.
const MachineOperand & getOperand(unsigned i) const
LLVM_ABI MachineInstrBundleIterator< MachineInstr > eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
A description of a memory reference used in the backend.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineBasicBlock * getMBB() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
unsigned getTargetFlags() const
static MachineOperand CreateImm(int64_t Val)
Register getReg() const
getReg - Returns the register number.
MCSymbol * getMCSymbol() const
static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
MCInst getNop() const override
bool SafeAfterMflo(const MachineInstr &MI) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
bool SafeInForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction can go in a forbidden slot.
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
Return the number of bytes of code the specified instruction may be.
MachineInstrBuilder insertNop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL) const
Insert an ISA appropriate nop.
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
Determine if the branch target is in range.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Branch Analysis.
const MipsSubtarget & Subtarget
MachineMemOperand * GetMemOperand(MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const
MachineInstrBuilder genInstrWithNewOpc(unsigned NewOpc, MachineBasicBlock::iterator I) const
Create an instruction which has the same operands and memory operands as MI but has a new opcode.
bool HasForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction has a forbidden slot.
bool SafeInFPUDelaySlot(const MachineInstr &MIInSlot, const MachineInstr &FPUMI) const
Predicate to determine if an instruction can go in an FPU delay slot.
bool isZeroImm(const MachineOperand &op) const
unsigned getEquivalentCompactForm(const MachineBasicBlock::iterator I) const
Determine the opcode of a non-delay slot form for a branch if one exists.
bool SafeInLoadDelaySlot(const MachineInstr &MIInSlot, const MachineInstr &LoadMI) const
Predicate to determine if an instruction can go in a load delay slot.
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
reverseBranchCondition - Return the inverse opcode of the specified Branch instruction.
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
const TargetRegisterClass * getInlineAsmMemoryOperandRegClass(InlineAsm::ConstraintCode C) const override
std::optional< RegImmPair > isAddImmediate(const MachineInstr &MI, Register Reg) const override
bool HasFPUDelaySlot(const MachineInstr &MI) const
Predicate to determine if an instruction has an FPU delay slot.
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
Perform target specific instruction verification.
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
static const MipsInstrInfo * create(MipsSubtarget &STI)
bool IsMfloOrMfhi(const MachineInstr &MI) const
bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const override
std::optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const override
MipsInstrInfo(const MipsSubtarget &STI, const MipsRegisterInfo &RI, unsigned UncondBrOpc)
virtual unsigned getOppositeBranchOpc(unsigned Opc) const =0
bool HasLoadDelaySlot(const MachineInstr &MI) const
Predicate to determine if an instruction has a load delay slot.
bool isAsCheapAsAMove(const MachineInstr &MI) const override
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
Insert nop instruction when hazard condition is found.
bool inMips16Mode() const
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
iterator insert(iterator I, T &&Elt)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
virtual bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const
Returns true iff the routine could find two commutable operands in the given machine instruction.
virtual std::optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const
Produce the expression describing the MI loading a value into the physical register Reg.
const MCAsmInfo & getMCAsmInfo() const
Return target specific asm information.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MipsII - This namespace holds all of the target specific flags that instruction info tracks.
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.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
const MipsInstrInfo * createMipsSEInstrInfo(const MipsSubtarget &STI)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
const MipsInstrInfo * createMips16InstrInfo(const MipsSubtarget &STI)
Create MipsInstrInfo objects.
std::pair< MachineOperand, DIExpression * > ParamLoadedValue
MCRegisterClass TargetRegisterClass
static LLVM_ABI MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
Used to describe a register and immediate addition.