50 if ((Opc == Mips::LW) || (Opc ==
Mips::LD) ||
51 (Opc == Mips::LWC1) || (Opc == Mips::LDC1) || (Opc == Mips::LDC164)) {
72 if ((Opc == Mips::SW) || (Opc == Mips::SD) ||
73 (Opc == Mips::SWC1) || (Opc == Mips::SDC1) || (Opc == Mips::SDC164)) {
86 const DebugLoc &DL,
unsigned DestReg,
87 unsigned SrcReg,
bool KillSrc)
const {
88 unsigned Opc = 0, ZeroReg = 0;
91 if (Mips::GPR32RegClass.
contains(DestReg)) {
92 if (Mips::GPR32RegClass.
contains(SrcReg)) {
94 Opc = Mips::MOVE16_MM;
96 Opc =
Mips::OR, ZeroReg = Mips::ZERO;
97 }
else if (Mips::CCRRegClass.
contains(SrcReg))
99 else if (Mips::FGR32RegClass.
contains(SrcReg))
101 else if (Mips::HI32RegClass.
contains(SrcReg)) {
102 Opc = isMicroMips ? Mips::MFHI16_MM :
Mips::MFHI;
104 }
else if (Mips::LO32RegClass.
contains(SrcReg)) {
105 Opc = isMicroMips ? Mips::MFLO16_MM :
Mips::MFLO;
107 }
else if (Mips::HI32DSPRegClass.
contains(SrcReg))
108 Opc = Mips::MFHI_DSP;
109 else if (Mips::LO32DSPRegClass.
contains(SrcReg))
110 Opc = Mips::MFLO_DSP;
111 else if (Mips::DSPCCRegClass.
contains(SrcReg)) {
112 BuildMI(MBB, I, DL,
get(Mips::RDDSP), DestReg).
addImm(1 << 4)
116 else if (Mips::MSACtrlRegClass.
contains(SrcReg))
119 else if (Mips::GPR32RegClass.
contains(SrcReg)) {
120 if (Mips::CCRRegClass.
contains(DestReg))
122 else if (Mips::FGR32RegClass.
contains(DestReg))
124 else if (Mips::HI32RegClass.
contains(DestReg))
125 Opc = Mips::MTHI, DestReg = 0;
126 else if (Mips::LO32RegClass.
contains(DestReg))
127 Opc = Mips::MTLO, DestReg = 0;
128 else if (Mips::HI32DSPRegClass.
contains(DestReg))
129 Opc = Mips::MTHI_DSP;
130 else if (Mips::LO32DSPRegClass.
contains(DestReg))
131 Opc = Mips::MTLO_DSP;
132 else if (Mips::DSPCCRegClass.
contains(DestReg)) {
133 BuildMI(MBB, I, DL,
get(Mips::WRDSP))
137 }
else if (Mips::MSACtrlRegClass.
contains(DestReg)) {
138 BuildMI(MBB, I, DL,
get(Mips::CTCMSA))
144 else if (Mips::FGR32RegClass.
contains(DestReg, SrcReg))
146 else if (Mips::AFGR64RegClass.
contains(DestReg, SrcReg))
147 Opc = Mips::FMOV_D32;
148 else if (Mips::FGR64RegClass.
contains(DestReg, SrcReg))
149 Opc = Mips::FMOV_D64;
150 else if (Mips::GPR64RegClass.
contains(DestReg)) {
151 if (Mips::GPR64RegClass.
contains(SrcReg))
152 Opc = Mips::OR64, ZeroReg = Mips::ZERO_64;
153 else if (Mips::HI64RegClass.
contains(SrcReg))
154 Opc = Mips::MFHI64, SrcReg = 0;
155 else if (Mips::LO64RegClass.
contains(SrcReg))
156 Opc = Mips::MFLO64, SrcReg = 0;
157 else if (Mips::FGR64RegClass.
contains(SrcReg))
160 else if (Mips::GPR64RegClass.
contains(SrcReg)) {
161 if (Mips::HI64RegClass.
contains(DestReg))
162 Opc = Mips::MTHI64, DestReg = 0;
163 else if (Mips::LO64RegClass.
contains(DestReg))
164 Opc = Mips::MTLO64, DestReg = 0;
165 else if (Mips::FGR64RegClass.
contains(DestReg))
168 else if (Mips::MSA128BRegClass.
contains(DestReg)) {
169 if (Mips::MSA128BRegClass.
contains(SrcReg))
173 assert(Opc &&
"Cannot copy registers");
228 bool isDSPControlWrite =
false;
234 else if (isDSPControlWrite) {
252 unsigned SrcReg,
bool isKill,
int FI,
260 if (Mips::GPR32RegClass.hasSubClassEq(RC))
262 else if (Mips::GPR64RegClass.hasSubClassEq(RC))
264 else if (Mips::ACC64RegClass.hasSubClassEq(RC))
265 Opc = Mips::STORE_ACC64;
266 else if (Mips::ACC64DSPRegClass.hasSubClassEq(RC))
267 Opc = Mips::STORE_ACC64DSP;
268 else if (Mips::ACC128RegClass.hasSubClassEq(RC))
269 Opc = Mips::STORE_ACC128;
270 else if (Mips::DSPCCRegClass.hasSubClassEq(RC))
271 Opc = Mips::STORE_CCOND_DSP;
272 else if (Mips::FGR32RegClass.hasSubClassEq(RC))
274 else if (Mips::AFGR64RegClass.hasSubClassEq(RC))
276 else if (Mips::FGR64RegClass.hasSubClassEq(RC))
289 else if (Mips::LO32RegClass.hasSubClassEq(RC))
291 else if (Mips::LO64RegClass.hasSubClassEq(RC))
293 else if (Mips::HI32RegClass.hasSubClassEq(RC))
295 else if (Mips::HI64RegClass.hasSubClassEq(RC))
297 else if (Mips::DSPRRegClass.hasSubClassEq(RC))
304 if (Mips::HI32RegClass.hasSubClassEq(RC)) {
307 }
else if (Mips::HI64RegClass.hasSubClassEq(RC)) {
308 BuildMI(MBB, I, DL,
get(Mips::MFHI64), Mips::K0_64);
309 SrcReg = Mips::K0_64;
310 }
else if (Mips::LO32RegClass.hasSubClassEq(RC)) {
313 }
else if (Mips::LO64RegClass.hasSubClassEq(RC)) {
314 BuildMI(MBB, I, DL,
get(Mips::MFLO64), Mips::K0_64);
315 SrcReg = Mips::K0_64;
319 assert(Opc &&
"Register class not handled!");
329 if (I != MBB.
end()) DL = I->getDebugLoc();
335 (DestReg == Mips::LO0 || DestReg == Mips::LO0_64 ||
336 DestReg == Mips::HI0 || DestReg == Mips::HI0_64);
338 if (Mips::GPR32RegClass.hasSubClassEq(RC))
340 else if (Mips::GPR64RegClass.hasSubClassEq(RC))
342 else if (Mips::ACC64RegClass.hasSubClassEq(RC))
343 Opc = Mips::LOAD_ACC64;
344 else if (Mips::ACC64DSPRegClass.hasSubClassEq(RC))
345 Opc = Mips::LOAD_ACC64DSP;
346 else if (Mips::ACC128RegClass.hasSubClassEq(RC))
347 Opc = Mips::LOAD_ACC128;
348 else if (Mips::DSPCCRegClass.hasSubClassEq(RC))
349 Opc = Mips::LOAD_CCOND_DSP;
350 else if (Mips::FGR32RegClass.hasSubClassEq(RC))
352 else if (Mips::AFGR64RegClass.hasSubClassEq(RC))
354 else if (Mips::FGR64RegClass.hasSubClassEq(RC))
367 else if (Mips::HI32RegClass.hasSubClassEq(RC))
369 else if (Mips::HI64RegClass.hasSubClassEq(RC))
371 else if (Mips::LO32RegClass.hasSubClassEq(RC))
373 else if (Mips::LO64RegClass.hasSubClassEq(RC))
375 else if (Mips::DSPRRegClass.hasSubClassEq(RC))
378 assert(Opc &&
"Register class not handled!");
380 if (!ReqIndirectLoad)
381 BuildMI(MBB, I, DL,
get(Opc), DestReg)
388 unsigned Reg = Mips::K0;
389 unsigned LdOp = Mips::MTLO;
390 if (DestReg == Mips::HI0)
395 if (DestReg == Mips::HI0_64)
401 BuildMI(MBB, I, DL,
get(Opc), Reg)
418 expandRetRA(MBB, MI);
423 case Mips::PseudoMFHI:
426 case Mips::PseudoMFHI_MM:
427 expandPseudoMFHiLo(MBB, MI, Mips::MFHI16_MM);
429 case Mips::PseudoMFLO:
432 case Mips::PseudoMFLO_MM:
433 expandPseudoMFHiLo(MBB, MI, Mips::MFLO16_MM);
435 case Mips::PseudoMFHI64:
436 expandPseudoMFHiLo(MBB, MI, Mips::MFHI64);
438 case Mips::PseudoMFLO64:
439 expandPseudoMFHiLo(MBB, MI, Mips::MFLO64);
441 case Mips::PseudoMTLOHI:
442 expandPseudoMTLoHi(MBB, MI, Mips::MTLO, Mips::MTHI,
false);
444 case Mips::PseudoMTLOHI64:
445 expandPseudoMTLoHi(MBB, MI, Mips::MTLO64, Mips::MTHI64,
false);
447 case Mips::PseudoMTLOHI_DSP:
448 expandPseudoMTLoHi(MBB, MI, Mips::MTLO_DSP, Mips::MTHI_DSP,
true);
450 case Mips::PseudoMTLOHI_MM:
451 expandPseudoMTLoHi(MBB, MI, Mips::MTLO_MM, Mips::MTHI_MM,
false);
453 case Mips::PseudoCVT_S_W:
454 expandCvtFPInt(MBB, MI, Mips::CVT_S_W, Mips::MTC1,
false);
456 case Mips::PseudoCVT_D32_W:
457 Opc = isMicroMips ? Mips::CVT_D32_W_MM : Mips::CVT_D32_W;
458 expandCvtFPInt(MBB, MI, Opc, Mips::MTC1,
false);
460 case Mips::PseudoCVT_S_L:
461 expandCvtFPInt(MBB, MI, Mips::CVT_S_L, Mips::DMTC1,
true);
463 case Mips::PseudoCVT_D64_W:
464 Opc = isMicroMips ? Mips::CVT_D64_W_MM : Mips::CVT_D64_W;
465 expandCvtFPInt(MBB, MI, Opc, Mips::MTC1,
true);
467 case Mips::PseudoCVT_D64_L:
468 expandCvtFPInt(MBB, MI, Mips::CVT_D64_L, Mips::DMTC1,
true);
471 expandBuildPairF64(MBB, MI, isMicroMips,
false);
473 case Mips::BuildPairF64_64:
474 expandBuildPairF64(MBB, MI, isMicroMips,
true);
477 expandExtractElementF64(MBB, MI, isMicroMips,
false);
479 case Mips::ExtractElementF64_64:
480 expandExtractElementF64(MBB, MI, isMicroMips,
true);
482 case Mips::MIPSeh_return32:
483 case Mips::MIPSeh_return64:
484 expandEhReturn(MBB, MI);
497 case Mips::BEQ:
return Mips::BNE;
498 case Mips::BEQ_MM:
return Mips::BNE_MM;
499 case Mips::BNE:
return Mips::BEQ;
500 case Mips::BNE_MM:
return Mips::BEQ_MM;
501 case Mips::BGTZ:
return Mips::BLEZ;
502 case Mips::BGEZ:
return Mips::BLTZ;
503 case Mips::BLTZ:
return Mips::BGEZ;
504 case Mips::BLEZ:
return Mips::BGTZ;
505 case Mips::BGTZ_MM:
return Mips::BLEZ_MM;
506 case Mips::BGEZ_MM:
return Mips::BLTZ_MM;
507 case Mips::BLTZ_MM:
return Mips::BGEZ_MM;
508 case Mips::BLEZ_MM:
return Mips::BGTZ_MM;
509 case Mips::BEQ64:
return Mips::BNE64;
510 case Mips::BNE64:
return Mips::BEQ64;
511 case Mips::BGTZ64:
return Mips::BLEZ64;
512 case Mips::BGEZ64:
return Mips::BLTZ64;
513 case Mips::BLTZ64:
return Mips::BGEZ64;
514 case Mips::BLEZ64:
return Mips::BGTZ64;
515 case Mips::BC1T:
return Mips::BC1F;
516 case Mips::BC1F:
return Mips::BC1T;
517 case Mips::BC1T_MM:
return Mips::BC1F_MM;
518 case Mips::BC1F_MM:
return Mips::BC1T_MM;
519 case Mips::BEQZ16_MM:
return Mips::BNEZ16_MM;
520 case Mips::BNEZ16_MM:
return Mips::BEQZ16_MM;
521 case Mips::BEQZC_MM:
return Mips::BNEZC_MM;
522 case Mips::BNEZC_MM:
return Mips::BEQZC_MM;
523 case Mips::BEQZC:
return Mips::BNEZC;
524 case Mips::BNEZC:
return Mips::BEQZC;
525 case Mips::BLEZC:
return Mips::BGTZC;
526 case Mips::BGEZC:
return Mips::BLTZC;
527 case Mips::BGEC:
return Mips::BLTC;
528 case Mips::BGTZC:
return Mips::BLEZC;
529 case Mips::BLTZC:
return Mips::BGEZC;
530 case Mips::BLTC:
return Mips::BGEC;
531 case Mips::BGEUC:
return Mips::BLTUC;
532 case Mips::BLTUC:
return Mips::BGEUC;
533 case Mips::BEQC:
return Mips::BNEC;
534 case Mips::BNEC:
return Mips::BEQC;
535 case Mips::BC1EQZ:
return Mips::BC1NEZ;
536 case Mips::BC1NEZ:
return Mips::BC1EQZ;
537 case Mips::BEQZC_MMR6:
return Mips::BNEZC_MMR6;
538 case Mips::BNEZC_MMR6:
return Mips::BEQZC_MMR6;
539 case Mips::BLEZC_MMR6:
return Mips::BGTZC_MMR6;
540 case Mips::BGEZC_MMR6:
return Mips::BLTZC_MMR6;
541 case Mips::BGEC_MMR6:
return Mips::BLTC_MMR6;
542 case Mips::BGTZC_MMR6:
return Mips::BLEZC_MMR6;
543 case Mips::BLTZC_MMR6:
return Mips::BGEZC_MMR6;
544 case Mips::BLTC_MMR6:
return Mips::BGEC_MMR6;
545 case Mips::BGEUC_MMR6:
return Mips::BLTUC_MMR6;
546 case Mips::BLTUC_MMR6:
return Mips::BGEUC_MMR6;
547 case Mips::BEQC_MMR6:
return Mips::BNEC_MMR6;
548 case Mips::BNEC_MMR6:
return Mips::BEQC_MMR6;
549 case Mips::BC1EQZC_MMR6:
return Mips::BC1NEZC_MMR6;
550 case Mips::BC1NEZC_MMR6:
return Mips::BC1EQZC_MMR6;
551 case Mips::BEQZC64:
return Mips::BNEZC64;
552 case Mips::BNEZC64:
return Mips::BEQZC64;
553 case Mips::BEQC64:
return Mips::BNEC64;
554 case Mips::BNEC64:
return Mips::BEQC64;
555 case Mips::BGEC64:
return Mips::BLTC64;
556 case Mips::BGEUC64:
return Mips::BLTUC64;
557 case Mips::BLTC64:
return Mips::BGEC64;
558 case Mips::BLTUC64:
return Mips::BGEUC64;
559 case Mips::BGTZC64:
return Mips::BLEZC64;
560 case Mips::BGEZC64:
return Mips::BLTZC64;
561 case Mips::BLTZC64:
return Mips::BGEZC64;
562 case Mips::BLEZC64:
return Mips::BGTZC64;
563 case Mips::BBIT0:
return Mips::BBIT1;
564 case Mips::BBIT1:
return Mips::BBIT0;
565 case Mips::BBIT032:
return Mips::BBIT132;
566 case Mips::BBIT132:
return Mips::BBIT032;
567 case Mips::BZ_B:
return Mips::BNZ_B;
568 case Mips::BZ_H:
return Mips::BNZ_H;
569 case Mips::BZ_W:
return Mips::BNZ_W;
570 case Mips::BZ_D:
return Mips::BNZ_D;
571 case Mips::BZ_V:
return Mips::BNZ_V;
572 case Mips::BNZ_B:
return Mips::BZ_B;
573 case Mips::BNZ_H:
return Mips::BZ_H;
574 case Mips::BNZ_W:
return Mips::BZ_W;
575 case Mips::BNZ_D:
return Mips::BZ_D;
576 case Mips::BNZ_V:
return Mips::BZ_V;
612 unsigned *NewImm)
const {
617 unsigned LUi = STI.
isABI_N64() ? Mips::LUi64 : Mips::LUi;
618 unsigned ZEROReg = STI.
isABI_N64() ? Mips::ZERO_64 : Mips::ZERO;
620 &Mips::GPR64RegClass : &Mips::GPR32RegClass;
621 bool LastInstrIsADDiu = NewImm;
624 AnalyzeImm.
Analyze(Imm, Size, LastInstrIsADDiu);
634 if (Inst->Opc == LUi)
635 BuildMI(MBB, II, DL,
get(LUi), Reg).
addImm(SignExtend64<16>(Inst->ImmOpnd));
638 .
addImm(SignExtend64<16>(Inst->ImmOpnd));
641 for (++Inst; Inst != Seq.
end() - LastInstrIsADDiu; ++Inst)
643 .
addImm(SignExtend64<16>(Inst->ImmOpnd));
645 if (LastInstrIsADDiu)
646 *NewImm = Inst->ImmOpnd;
651 unsigned MipsSEInstrInfo::getAnalyzableBrOpc(
unsigned Opc)
const {
652 return (Opc == Mips::BEQ || Opc == Mips::BEQ_MM || Opc == Mips::BNE ||
653 Opc == Mips::BNE_MM || Opc == Mips::BGTZ || Opc == Mips::BGEZ ||
654 Opc == Mips::BLTZ || Opc == Mips::BLEZ || Opc == Mips::BEQ64 ||
655 Opc == Mips::BNE64 || Opc == Mips::BGTZ64 || Opc == Mips::BGEZ64 ||
656 Opc == Mips::BLTZ64 || Opc == Mips::BLEZ64 || Opc == Mips::BC1T ||
657 Opc == Mips::BC1F || Opc ==
Mips::B || Opc == Mips::J ||
658 Opc == Mips::J_MM || Opc == Mips::B_MM || Opc == Mips::BEQZC_MM ||
659 Opc == Mips::BNEZC_MM || Opc == Mips::BEQC || Opc == Mips::BNEC ||
660 Opc == Mips::BLTC || Opc == Mips::BGEC || Opc == Mips::BLTUC ||
661 Opc == Mips::BGEUC || Opc == Mips::BGTZC || Opc == Mips::BLEZC ||
662 Opc == Mips::BGEZC || Opc == Mips::BLTZC || Opc == Mips::BEQZC ||
663 Opc == Mips::BNEZC || Opc == Mips::BEQZC64 || Opc == Mips::BNEZC64 ||
664 Opc == Mips::BEQC64 || Opc == Mips::BNEC64 || Opc == Mips::BGEC64 ||
665 Opc == Mips::BGEUC64 || Opc == Mips::BLTC64 || Opc == Mips::BLTUC64 ||
666 Opc == Mips::BGTZC64 || Opc == Mips::BGEZC64 ||
667 Opc == Mips::BLTZC64 || Opc == Mips::BLEZC64 || Opc == Mips::BC ||
668 Opc == Mips::BBIT0 || Opc == Mips::BBIT1 || Opc == Mips::BBIT032 ||
669 Opc == Mips::BBIT132 || Opc == Mips::BC_MMR6 ||
670 Opc == Mips::BEQC_MMR6 || Opc == Mips::BNEC_MMR6 ||
671 Opc == Mips::BLTC_MMR6 || Opc == Mips::BGEC_MMR6 ||
672 Opc == Mips::BLTUC_MMR6 || Opc == Mips::BGEUC_MMR6 ||
673 Opc == Mips::BGTZC_MMR6 || Opc == Mips::BLEZC_MMR6 ||
674 Opc == Mips::BGEZC_MMR6 || Opc == Mips::BLTZC_MMR6 ||
675 Opc == Mips::BEQZC_MMR6 || Opc == Mips::BNEZC_MMR6) ? Opc : 0;
683 MIB =
BuildMI(MBB, I, I->getDebugLoc(),
get(Mips::PseudoReturn64))
686 MIB =
BuildMI(MBB, I, I->getDebugLoc(),
get(Mips::PseudoReturn))
690 for (
auto & MO : I->operands()) {
698 BuildMI(MBB, I, I->getDebugLoc(),
get(Mips::ERET));
701 std::pair<bool, bool>
702 MipsSEInstrInfo::compareOpndSize(
unsigned Opc,
707 unsigned DstRegSize = RI->getRegSizeInBits(*
getRegClass(Desc, 0, RI, MF));
708 unsigned SrcRegSize = RI->getRegSizeInBits(*
getRegClass(Desc, 1, RI, MF));
710 return std::make_pair(DstRegSize > SrcRegSize, DstRegSize < SrcRegSize);
715 unsigned NewOpc)
const {
716 BuildMI(MBB, I, I->getDebugLoc(),
get(NewOpc), I->getOperand(0).getReg());
723 bool HasExplicitDef)
const {
731 const MachineOperand &SrcLo = I->getOperand(1), &SrcHi = I->getOperand(2);
737 if (HasExplicitDef) {
738 unsigned DstReg = I->getOperand(0).getReg();
751 unsigned CvtOpc,
unsigned MovOpc,
753 const MCInstrDesc &CvtDesc =
get(CvtOpc), &MovDesc =
get(MovOpc);
754 const MachineOperand &Dst = I->getOperand(0), &Src = I->getOperand(1);
755 unsigned DstReg = Dst.
getReg(), SrcReg = Src.getReg(), TmpReg = DstReg;
758 bool DstIsLarger, SrcIsLarger;
760 std::tie(DstIsLarger, SrcIsLarger) =
761 compareOpndSize(CvtOpc, *MBB.
getParent());
769 BuildMI(MBB, I, DL, MovDesc, TmpReg).
addReg(SrcReg, KillSrc);
777 unsigned DstReg = I->getOperand(0).getReg();
778 unsigned SrcReg = I->getOperand(1).getReg();
779 unsigned N = I->getOperand(2).getImm();
782 assert(N < 2 &&
"Invalid immediate");
783 unsigned SubIdx = N ? Mips::sub_hi : Mips::sub_lo;
808 get(isMicroMips ? (FP64 ? Mips::MFHC1_D64_MM : Mips::MFHC1_D32_MM)
809 : (FP64 ? Mips::MFHC1_D64 : Mips::MFHC1_D32)),
818 bool isMicroMips,
bool FP64)
const {
819 unsigned DstReg = I->getOperand(0).getReg();
820 unsigned LoReg = I->getOperand(1).getReg(), HiReg = I->getOperand(2).getReg();
864 get(isMicroMips ? (FP64 ? Mips::MTHC1_D64_MM : Mips::MTHC1_D32_MM)
865 : (FP64 ? Mips::MTHC1_D64 : Mips::MTHC1_D32)),
887 unsigned OffsetReg = I->getOperand(0).getReg();
888 unsigned TargetReg = I->getOperand(1).getReg();
895 BuildMI(MBB, I, I->getDebugLoc(),
get(ADDU), T9)
898 BuildMI(MBB, I, I->getDebugLoc(),
get(ADDU), RA)
const MachineInstrBuilder & add(const MachineOperand &MO) const
unsigned GetPtrAdduOp() const
typename SuperClass::const_iterator const_iterator
This class represents lattice values for constants.
bool isCopyInstrImpl(const MachineInstr &MI, const MachineOperand *&Source, const MachineOperand *&Destination) const override
If the specific machine instruction is a instruction that moves/copies value from one register to ano...
unsigned getOppositeBranchOpc(unsigned Opc) const override
getOppositeBranchOpc - Return the inverse of the specified opcode, e.g.
bool ArePtrs64bit() const
Describe properties that are true of each instruction in the target description file.
unsigned getReg() const
getReg - Returns the register number.
void loadRegFromStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
MachineMemOperand * GetMemOperand(MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const
constexpr bool isInt< 16 >(int64_t x)
unsigned const TargetRegisterInfo * TRI
static unsigned getUnconditionalBranch(const MipsSubtarget &STI)
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MipsSEInstrInfo(const MipsSubtarget &STI)
return AArch64::GPR64RegClass contains(Reg)
SI optimize exec mask operations pre RA
A description of a memory reference used in the backend.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
bool inMicroMipsMode() const
const MipsSubtarget & Subtarget
static int getRegClass(RegisterKind Is, unsigned RegWidth)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
Adjust SP by Amount bytes.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
bool isTypeLegalForClass(const TargetRegisterClass &RC, MVT T) const
Return true if the given TargetRegisterClass has the ValueType T.
unsigned getKillRegState(bool B)
unsigned short NumOperands
void storeRegToStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned GetPtrAddiuOp() const
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
static ManagedStatic< OptionRegistry > OR
unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot...
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
const MachineInstrBuilder & addFrameIndex(int Idx) const
bool isZeroImm(const MachineOperand &op) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MipsABIInfo & getABI() const
The memory access writes data.
bool isPositionIndependent() const
MachineOperand class - Representation of each machine instruction operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
const Function & getFunction() const
Return the LLVM function that this machine code represents.
bool expandPostRAPseudo(MachineInstr &MI) const override
unsigned GetPtrSubuOp() const
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool isMoveReg(QueryType Type=IgnoreBundle) const
Return true if this instruction is a register move.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool isPositionIndependent() const
static bool isORCopyInst(const MachineInstr &MI)
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
const MipsInstrInfo * createMipsSEInstrInfo(const MipsSubtarget &STI)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
unsigned loadImmediate(int64_t Imm, MachineBasicBlock &MBB, MachineBasicBlock::iterator II, const DebugLoc &DL, unsigned *NewImm) const
Emit a series of instructions to load an immediate.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
unsigned getOpcode() const
Return the opcode number for this descriptor.
Primary interface to the complete machine description for the target machine.
static bool isReadOrWriteToDSPReg(const MachineInstr &MI, bool &isWrite)
If is WRDSP/RRDSP instruction return true with set to true if it is WRDSP instruction.
const MachineOperand & getOperand(unsigned i) const
const MipsRegisterInfo & getRegisterInfo() const override
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...