39 int &FrameIndex)
const {
40 unsigned Opc =
MI.getOpcode();
42 if ((
Opc == Mips::LW) || (
Opc == Mips::LD) ||
43 (
Opc == Mips::LWC1) || (
Opc == Mips::LDC1) || (
Opc == Mips::LDC164)) {
44 if ((
MI.getOperand(1).isFI()) &&
45 (
MI.getOperand(2).isImm()) &&
47 FrameIndex =
MI.getOperand(1).getIndex();
48 return MI.getOperand(0).getReg();
61 int &FrameIndex)
const {
62 unsigned Opc =
MI.getOpcode();
64 if ((
Opc == Mips::SW) || (
Opc == Mips::SD) ||
65 (
Opc == Mips::SWC1) || (
Opc == Mips::SDC1) || (
Opc == Mips::SDC164)) {
66 if ((
MI.getOperand(1).isFI()) &&
67 (
MI.getOperand(2).isImm()) &&
69 FrameIndex =
MI.getOperand(1).getIndex();
70 return MI.getOperand(0).getReg();
80 bool RenamableDest,
bool RenamableSrc)
const {
81 unsigned Opc = 0, ZeroReg = 0;
84 if (Mips::GPR32RegClass.
contains(DestReg)) {
85 if (Mips::GPR32RegClass.
contains(SrcReg)) {
89 Opc = Mips::MOVE16_MM;
91 Opc = Mips::OR, ZeroReg = Mips::R0;
92 }
else if (Mips::CCRRegClass.
contains(SrcReg))
94 else if (Mips::FGR32RegClass.
contains(SrcReg))
96 else if (Mips::HI32RegClass.
contains(SrcReg)) {
99 }
else if (Mips::LO32RegClass.
contains(SrcReg)) {
102 }
else if (Mips::HI32DSPRegClass.
contains(SrcReg))
103 Opc = Mips::MFHI_DSP;
104 else if (Mips::LO32DSPRegClass.
contains(SrcReg))
105 Opc = Mips::MFLO_DSP;
106 else if (Mips::DSPCCRegClass.
contains(SrcReg)) {
110 }
else if (Mips::MSACtrlRegClass.
contains(SrcReg)) {
114 else if (Mips::GPR32RegClass.
contains(SrcReg)) {
115 if (Mips::CCRRegClass.
contains(DestReg))
117 else if (Mips::FGR32RegClass.
contains(DestReg))
119 else if (Mips::HI32RegClass.
contains(DestReg))
120 Opc = Mips::MTHI, DestReg = 0;
121 else if (Mips::LO32RegClass.
contains(DestReg))
122 Opc = Mips::MTLO, DestReg = 0;
123 else if (Mips::HI32DSPRegClass.
contains(DestReg))
124 Opc = Mips::MTHI_DSP;
125 else if (Mips::LO32DSPRegClass.
contains(DestReg))
126 Opc = Mips::MTLO_DSP;
127 else if (Mips::DSPCCRegClass.
contains(DestReg)) {
132 }
else if (Mips::MSACtrlRegClass.
contains(DestReg)) {
139 else if (Mips::FGR32RegClass.
contains(DestReg, SrcReg))
141 else if (Mips::AFGR64RegClass.
contains(DestReg, SrcReg))
142 Opc = Mips::FMOV_D32;
143 else if (Mips::FGR64RegClass.
contains(DestReg, SrcReg))
144 Opc = Mips::FMOV_D64;
145 else if (Mips::GPR64RegClass.
contains(DestReg)) {
146 if (Mips::GPR64RegClass.
contains(SrcReg))
147 Opc = Mips::OR64, ZeroReg = Mips::R0_64;
148 else if (Mips::HI64RegClass.
contains(SrcReg))
149 Opc = Mips::MFHI64, SrcReg = 0;
150 else if (Mips::LO64RegClass.
contains(SrcReg))
151 Opc = Mips::MFLO64, SrcReg = 0;
152 else if (Mips::FGR64RegClass.
contains(SrcReg))
155 else if (Mips::GPR64RegClass.
contains(SrcReg)) {
156 if (Mips::HI64RegClass.
contains(DestReg))
157 Opc = Mips::MTHI64, DestReg = 0;
158 else if (Mips::LO64RegClass.
contains(DestReg))
159 Opc = Mips::MTLO64, DestReg = 0;
160 else if (Mips::FGR64RegClass.
contains(DestReg))
162 }
else if (Mips::MSA128BRegClass.
contains(DestReg)) {
163 if (Mips::MSA128BRegClass.
contains(SrcReg))
182 switch (
MI.getOpcode()) {
187 if (
MI.getOperand(2).getReg() == Mips::R0)
191 if (
MI.getOperand(2).getReg() == Mips::R0_64)
201std::optional<DestSourcePair>
211 Register SrcReg,
bool isKill,
int FI,
220 if (Mips::GPR32RegClass.hasSubClassEq(RC))
222 else if (Mips::GPR64RegClass.hasSubClassEq(RC))
224 else if (Mips::ACC64RegClass.hasSubClassEq(RC))
225 Opc = Mips::STORE_ACC64;
226 else if (Mips::ACC64DSPRegClass.hasSubClassEq(RC))
227 Opc = Mips::STORE_ACC64DSP;
228 else if (Mips::ACC128RegClass.hasSubClassEq(RC))
229 Opc = Mips::STORE_ACC128;
230 else if (Mips::DSPCCRegClass.hasSubClassEq(RC))
231 Opc = Mips::STORE_CCOND_DSP;
232 else if (Mips::FGR32RegClass.hasSubClassEq(RC))
234 else if (Mips::AFGR64RegClass.hasSubClassEq(RC))
236 else if (Mips::FGR64RegClass.hasSubClassEq(RC))
238 else if (RI.isTypeLegalForClass(*RC, MVT::v16i8))
240 else if (RI.isTypeLegalForClass(*RC, MVT::v8i16) ||
241 RI.isTypeLegalForClass(*RC, MVT::v8f16))
243 else if (RI.isTypeLegalForClass(*RC, MVT::v4i32) ||
244 RI.isTypeLegalForClass(*RC, MVT::v4f32))
246 else if (RI.isTypeLegalForClass(*RC, MVT::v2i64) ||
247 RI.isTypeLegalForClass(*RC, MVT::v2f64))
249 else if (Mips::LO32RegClass.hasSubClassEq(RC))
251 else if (Mips::LO64RegClass.hasSubClassEq(RC))
253 else if (Mips::HI32RegClass.hasSubClassEq(RC))
255 else if (Mips::HI64RegClass.hasSubClassEq(RC))
257 else if (Mips::DSPRRegClass.hasSubClassEq(RC))
262 const Function &Func =
MBB.getParent()->getFunction();
263 if (Func.hasFnAttribute(
"interrupt")) {
264 if (Mips::HI32RegClass.hasSubClassEq(RC)) {
267 }
else if (Mips::HI64RegClass.hasSubClassEq(RC)) {
269 SrcReg = Mips::R26_64;
270 }
else if (Mips::LO32RegClass.hasSubClassEq(RC)) {
273 }
else if (Mips::LO64RegClass.hasSubClassEq(RC)) {
275 SrcReg = Mips::R26_64;
279 assert(
Opc &&
"Register class not handled!");
291 if (
I !=
MBB.end())
DL =
I->getDebugLoc();
295 const Function &Func =
MBB.getParent()->getFunction();
296 bool ReqIndirectLoad = Func.hasFnAttribute(
"interrupt") &&
297 (DestReg == Mips::LO0 || DestReg == Mips::LO0_64 ||
298 DestReg == Mips::HI0 || DestReg == Mips::HI0_64);
300 if (Mips::GPR32RegClass.hasSubClassEq(RC))
302 else if (Mips::GPR64RegClass.hasSubClassEq(RC))
304 else if (Mips::ACC64RegClass.hasSubClassEq(RC))
305 Opc = Mips::LOAD_ACC64;
306 else if (Mips::ACC64DSPRegClass.hasSubClassEq(RC))
307 Opc = Mips::LOAD_ACC64DSP;
308 else if (Mips::ACC128RegClass.hasSubClassEq(RC))
309 Opc = Mips::LOAD_ACC128;
310 else if (Mips::DSPCCRegClass.hasSubClassEq(RC))
311 Opc = Mips::LOAD_CCOND_DSP;
312 else if (Mips::FGR32RegClass.hasSubClassEq(RC))
314 else if (Mips::AFGR64RegClass.hasSubClassEq(RC))
316 else if (Mips::FGR64RegClass.hasSubClassEq(RC))
318 else if (RI.isTypeLegalForClass(*RC, MVT::v16i8))
320 else if (RI.isTypeLegalForClass(*RC, MVT::v8i16) ||
321 RI.isTypeLegalForClass(*RC, MVT::v8f16))
323 else if (RI.isTypeLegalForClass(*RC, MVT::v4i32) ||
324 RI.isTypeLegalForClass(*RC, MVT::v4f32))
326 else if (RI.isTypeLegalForClass(*RC, MVT::v2i64) ||
327 RI.isTypeLegalForClass(*RC, MVT::v2f64))
329 else if (Mips::HI32RegClass.hasSubClassEq(RC))
331 else if (Mips::HI64RegClass.hasSubClassEq(RC))
333 else if (Mips::LO32RegClass.hasSubClassEq(RC))
335 else if (Mips::LO64RegClass.hasSubClassEq(RC))
337 else if (Mips::DSPRRegClass.hasSubClassEq(RC))
340 assert(
Opc &&
"Register class not handled!");
342 if (!ReqIndirectLoad)
350 unsigned Reg = Mips::R26;
351 unsigned LdOp = Mips::MTLO;
352 if (DestReg == Mips::HI0)
357 if (DestReg == Mips::HI0_64)
376 switch (
MI.getDesc().getOpcode()) {
380 expandRetRA(
MBB,
MI);
385 case Mips::PseudoMFHI:
386 expandPseudoMFHiLo(
MBB,
MI, Mips::MFHI);
388 case Mips::PseudoMFHI_MM:
389 expandPseudoMFHiLo(
MBB,
MI, Mips::MFHI16_MM);
391 case Mips::PseudoMFLO:
392 expandPseudoMFHiLo(
MBB,
MI, Mips::MFLO);
394 case Mips::PseudoMFLO_MM:
395 expandPseudoMFHiLo(
MBB,
MI, Mips::MFLO16_MM);
397 case Mips::PseudoMFHI64:
398 expandPseudoMFHiLo(
MBB,
MI, Mips::MFHI64);
400 case Mips::PseudoMFLO64:
401 expandPseudoMFHiLo(
MBB,
MI, Mips::MFLO64);
403 case Mips::PseudoMTLOHI:
404 expandPseudoMTLoHi(
MBB,
MI, Mips::MTLO, Mips::MTHI,
false);
406 case Mips::PseudoMTLOHI64:
407 expandPseudoMTLoHi(
MBB,
MI, Mips::MTLO64, Mips::MTHI64,
false);
409 case Mips::PseudoMTLOHI_DSP:
410 expandPseudoMTLoHi(
MBB,
MI, Mips::MTLO_DSP, Mips::MTHI_DSP,
true);
412 case Mips::PseudoMTLOHI_MM:
413 expandPseudoMTLoHi(
MBB,
MI, Mips::MTLO_MM, Mips::MTHI_MM,
false);
415 case Mips::PseudoCVT_S_W:
416 expandCvtFPInt(
MBB,
MI, Mips::CVT_S_W, Mips::MTC1,
false);
418 case Mips::PseudoCVT_D32_W:
420 expandCvtFPInt(
MBB,
MI,
Opc, Mips::MTC1,
false);
422 case Mips::PseudoCVT_S_L:
423 expandCvtFPInt(
MBB,
MI, Mips::CVT_S_L, Mips::DMTC1,
true);
425 case Mips::PseudoCVT_D64_W:
427 expandCvtFPInt(
MBB,
MI,
Opc, Mips::MTC1,
true);
429 case Mips::PseudoCVT_D64_L:
430 expandCvtFPInt(
MBB,
MI, Mips::CVT_D64_L, Mips::DMTC1,
true);
432 case Mips::BuildPairF64:
435 case Mips::BuildPairF64_FPR:
436 MI.eraseFromParent();
438 case Mips::BuildPairF64_64:
441 case Mips::ExtractElementF64:
444 case Mips::ExtractElementF64_64:
447 case Mips::MIPSeh_return32:
448 case Mips::MIPSeh_return64:
449 expandEhReturn(
MBB,
MI);
476 case Mips::BEQ:
return Mips::BNE;
477 case Mips::BEQ_MM:
return Mips::BNE_MM;
478 case Mips::BNE:
return Mips::BEQ;
479 case Mips::BNE_MM:
return Mips::BEQ_MM;
480 case Mips::BGTZ:
return Mips::BLEZ;
481 case Mips::BGEZ:
return Mips::BLTZ;
482 case Mips::BLTZ:
return Mips::BGEZ;
483 case Mips::BLEZ:
return Mips::BGTZ;
484 case Mips::BGTZ_MM:
return Mips::BLEZ_MM;
485 case Mips::BGEZ_MM:
return Mips::BLTZ_MM;
486 case Mips::BLTZ_MM:
return Mips::BGEZ_MM;
487 case Mips::BLEZ_MM:
return Mips::BGTZ_MM;
488 case Mips::BEQ64:
return Mips::BNE64;
489 case Mips::BNE64:
return Mips::BEQ64;
490 case Mips::BGTZ64:
return Mips::BLEZ64;
491 case Mips::BGEZ64:
return Mips::BLTZ64;
492 case Mips::BLTZ64:
return Mips::BGEZ64;
493 case Mips::BLEZ64:
return Mips::BGTZ64;
494 case Mips::BC1T:
return Mips::BC1F;
495 case Mips::BC1F:
return Mips::BC1T;
496 case Mips::BC1T_MM:
return Mips::BC1F_MM;
497 case Mips::BC1F_MM:
return Mips::BC1T_MM;
498 case Mips::BEQZ16_MM:
return Mips::BNEZ16_MM;
499 case Mips::BNEZ16_MM:
return Mips::BEQZ16_MM;
500 case Mips::BEQZC_MM:
return Mips::BNEZC_MM;
501 case Mips::BNEZC_MM:
return Mips::BEQZC_MM;
502 case Mips::BEQZC:
return Mips::BNEZC;
503 case Mips::BNEZC:
return Mips::BEQZC;
504 case Mips::BLEZC:
return Mips::BGTZC;
505 case Mips::BGEZC:
return Mips::BLTZC;
506 case Mips::BGEC:
return Mips::BLTC;
507 case Mips::BGTZC:
return Mips::BLEZC;
508 case Mips::BLTZC:
return Mips::BGEZC;
509 case Mips::BLTC:
return Mips::BGEC;
510 case Mips::BGEUC:
return Mips::BLTUC;
511 case Mips::BLTUC:
return Mips::BGEUC;
512 case Mips::BEQC:
return Mips::BNEC;
513 case Mips::BNEC:
return Mips::BEQC;
514 case Mips::BC1EQZ:
return Mips::BC1NEZ;
515 case Mips::BC1NEZ:
return Mips::BC1EQZ;
516 case Mips::BEQZC_MMR6:
return Mips::BNEZC_MMR6;
517 case Mips::BNEZC_MMR6:
return Mips::BEQZC_MMR6;
518 case Mips::BLEZC_MMR6:
return Mips::BGTZC_MMR6;
519 case Mips::BGEZC_MMR6:
return Mips::BLTZC_MMR6;
520 case Mips::BGEC_MMR6:
return Mips::BLTC_MMR6;
521 case Mips::BGTZC_MMR6:
return Mips::BLEZC_MMR6;
522 case Mips::BLTZC_MMR6:
return Mips::BGEZC_MMR6;
523 case Mips::BLTC_MMR6:
return Mips::BGEC_MMR6;
524 case Mips::BGEUC_MMR6:
return Mips::BLTUC_MMR6;
525 case Mips::BLTUC_MMR6:
return Mips::BGEUC_MMR6;
526 case Mips::BEQC_MMR6:
return Mips::BNEC_MMR6;
527 case Mips::BNEC_MMR6:
return Mips::BEQC_MMR6;
528 case Mips::BC1EQZC_MMR6:
return Mips::BC1NEZC_MMR6;
529 case Mips::BC1NEZC_MMR6:
return Mips::BC1EQZC_MMR6;
530 case Mips::BEQZC64:
return Mips::BNEZC64;
531 case Mips::BNEZC64:
return Mips::BEQZC64;
532 case Mips::BEQC64:
return Mips::BNEC64;
533 case Mips::BNEC64:
return Mips::BEQC64;
534 case Mips::BGEC64:
return Mips::BLTC64;
535 case Mips::BGEUC64:
return Mips::BLTUC64;
536 case Mips::BLTC64:
return Mips::BGEC64;
537 case Mips::BLTUC64:
return Mips::BGEUC64;
538 case Mips::BGTZC64:
return Mips::BLEZC64;
539 case Mips::BGEZC64:
return Mips::BLTZC64;
540 case Mips::BLTZC64:
return Mips::BGEZC64;
541 case Mips::BLEZC64:
return Mips::BGTZC64;
542 case Mips::BBIT0:
return Mips::BBIT1;
543 case Mips::BBIT1:
return Mips::BBIT0;
544 case Mips::BBIT032:
return Mips::BBIT132;
545 case Mips::BBIT132:
return Mips::BBIT032;
546 case Mips::BZ_B:
return Mips::BNZ_B;
547 case Mips::BZ_H:
return Mips::BNZ_H;
548 case Mips::BZ_W:
return Mips::BNZ_W;
549 case Mips::BZ_D:
return Mips::BNZ_D;
550 case Mips::BZ_V:
return Mips::BNZ_V;
551 case Mips::BNZ_B:
return Mips::BZ_B;
552 case Mips::BNZ_H:
return Mips::BZ_H;
553 case Mips::BNZ_W:
return Mips::BZ_W;
554 case Mips::BNZ_D:
return Mips::BZ_D;
555 case Mips::BNZ_V:
return Mips::BZ_V;
565 unsigned ADDiu = ABI.GetPtrAddiuOp();
576 unsigned Opc = ABI.GetPtrAdduOp();
578 Opc = ABI.GetPtrSubuOp();
591 unsigned *NewImm)
const {
596 unsigned LUi = STI.
isABI_N64() ? Mips::LUi64 : Mips::LUi;
597 unsigned ZEROReg = STI.
isABI_N64() ? Mips::R0_64 : Mips::R0;
599 &Mips::GPR64RegClass : &Mips::GPR32RegClass;
600 bool LastInstrIsADDiu = NewImm;
611 Register Reg = RegInfo.createVirtualRegister(RC);
613 if (Inst->Opc == LUi)
620 for (++Inst; Inst != Seq.
end() - LastInstrIsADDiu; ++Inst)
624 if (LastInstrIsADDiu)
625 *NewImm = Inst->ImmOpnd;
630unsigned MipsSEInstrInfo::getAnalyzableBrOpc(
unsigned Opc)
const {
631 return (
Opc == Mips::BEQ ||
Opc == Mips::BEQ_MM ||
Opc == Mips::BNE ||
632 Opc == Mips::BNE_MM ||
Opc == Mips::BGTZ ||
Opc == Mips::BGEZ ||
633 Opc == Mips::BLTZ ||
Opc == Mips::BLEZ ||
Opc == Mips::BEQ64 ||
634 Opc == Mips::BNE64 ||
Opc == Mips::BGTZ64 ||
Opc == Mips::BGEZ64 ||
635 Opc == Mips::BLTZ64 ||
Opc == Mips::BLEZ64 ||
Opc == Mips::BC1T ||
636 Opc == Mips::BC1F ||
Opc == Mips::B ||
Opc == Mips::J ||
637 Opc == Mips::J_MM ||
Opc == Mips::B_MM ||
Opc == Mips::BEQZC_MM ||
638 Opc == Mips::BNEZC_MM ||
Opc == Mips::BEQC ||
Opc == Mips::BNEC ||
639 Opc == Mips::BLTC ||
Opc == Mips::BGEC ||
Opc == Mips::BLTUC ||
640 Opc == Mips::BGEUC ||
Opc == Mips::BGTZC ||
Opc == Mips::BLEZC ||
641 Opc == Mips::BGEZC ||
Opc == Mips::BLTZC ||
Opc == Mips::BEQZC ||
642 Opc == Mips::BNEZC ||
Opc == Mips::BEQZC64 ||
Opc == Mips::BNEZC64 ||
643 Opc == Mips::BEQC64 ||
Opc == Mips::BNEC64 ||
Opc == Mips::BGEC64 ||
644 Opc == Mips::BGEUC64 ||
Opc == Mips::BLTC64 ||
Opc == Mips::BLTUC64 ||
645 Opc == Mips::BGTZC64 ||
Opc == Mips::BGEZC64 ||
646 Opc == Mips::BLTZC64 ||
Opc == Mips::BLEZC64 ||
Opc == Mips::BC ||
647 Opc == Mips::BC1EQZ ||
Opc == Mips::BC1NEZ ||
Opc == Mips::BBIT0 ||
648 Opc == Mips::BBIT1 ||
Opc == Mips::BBIT032 ||
Opc == Mips::BBIT132 ||
649 Opc == Mips::BC_MMR6 ||
Opc == Mips::BEQC_MMR6 ||
650 Opc == Mips::BNEC_MMR6 ||
Opc == Mips::BLTC_MMR6 ||
651 Opc == Mips::BGEC_MMR6 ||
Opc == Mips::BLTUC_MMR6 ||
652 Opc == Mips::BGEUC_MMR6 ||
Opc == Mips::BGTZC_MMR6 ||
653 Opc == Mips::BLEZC_MMR6 ||
Opc == Mips::BGEZC_MMR6 ||
654 Opc == Mips::BLTZC_MMR6 ||
Opc == Mips::BEQZC_MMR6 ||
655 Opc == Mips::BNEZC_MMR6 ||
Opc == Mips::BC1EQZC_MMR6 ||
656 Opc == Mips::BC1NEZC_MMR6)
673 for (
auto & MO :
I->operands()) {
685MipsSEInstrInfo::compareOpndSize(
unsigned Opc,
688 assert(
Desc.NumOperands == 2 &&
"Unary instruction expected.");
693 return std::make_pair(DstRegSize > SrcRegSize, DstRegSize < SrcRegSize);
698 unsigned NewOpc)
const {
706 bool HasExplicitDef)
const {
714 const MachineOperand &SrcLo =
I->getOperand(1), &SrcHi =
I->getOperand(2);
720 if (HasExplicitDef) {
721 Register DstReg =
I->getOperand(0).getReg();
734 unsigned CvtOpc,
unsigned MovOpc,
736 const MCInstrDesc &CvtDesc =
get(CvtOpc), &MovDesc =
get(MovOpc);
737 const MachineOperand &Dst =
I->getOperand(0), &Src =
I->getOperand(1);
738 unsigned DstReg = Dst.getReg(), SrcReg = Src.getReg(), TmpReg = DstReg;
741 bool DstIsLarger, SrcIsLarger;
743 std::tie(DstIsLarger, SrcIsLarger) =
760 Register DstReg =
I->getOperand(0).getReg();
761 Register SrcReg =
I->getOperand(1).getReg();
762 unsigned N =
I->getOperand(2).getImm();
765 assert(
N < 2 &&
"Invalid immediate");
766 unsigned SubIdx =
N ? Mips::sub_hi : Mips::sub_lo;
777 if (SubIdx == Mips::sub_hi &&
Subtarget.hasMTHC1()) {
791 get(
isMicroMips ? (FP64 ? Mips::MFHC1_D64_MM : Mips::MFHC1_D32_MM)
792 : (FP64 ? Mips::MFHC1_D64 : Mips::MFHC1_D32)),
802 Register DstReg =
I->getOperand(0).getReg();
803 unsigned LoReg =
I->getOperand(1).getReg(), HiReg =
I->getOperand(2).getReg();
804 const MCInstrDesc& Mtc1Tdd =
get(Mips::MTC1);
847 get(
isMicroMips ? (FP64 ? Mips::MTHC1_D64_MM : Mips::MTHC1_D32_MM)
848 : (FP64 ? Mips::MTHC1_D64 : Mips::MTHC1_D32)),
865 unsigned ADDU =
ABI.GetPtrAdduOp();
869 unsigned ZERO =
Subtarget.isGP64bit() ? Mips::R0_64 : Mips::R0;
870 Register OffsetReg =
I->getOperand(0).getReg();
871 Register TargetReg =
I->getOperand(1).getReg();
const AArch64Subtarget & Subtarget
static const TargetRegisterClass * getRegClass(const MachineInstr &MI, Register Reg)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
@ ZERO
Special weight used for cases with exact zero probability.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
static bool isORCopyInst(const MachineInstr &MI)
static unsigned getUnconditionalBranch(const MipsSubtarget &STI)
static bool isMicroMips(const MCSubtargetInfo *STI)
uint64_t IntrinsicInst * II
SI optimize exec mask operations pre RA
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineInstrBundleIterator< MachineInstr > iterator
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 & addFrameIndex(int Idx) const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
Representation of each machine instruction.
A description of a memory reference used in the backend.
@ MOLoad
The memory access reads data.
@ MOStore
The memory access writes data.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const MipsSubtarget & Subtarget
MachineMemOperand * GetMemOperand(MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const
bool isZeroImm(const MachineOperand &op) const
MipsInstrInfo(const MipsSubtarget &STI, const MipsRegisterInfo &RI, unsigned UncondBrOpc)
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot,...
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot,...
void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
Adjust SP by Amount bytes.
std::optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
If the specific machine instruction is a instruction that moves/copies value from one register to ano...
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.
bool isBranchWithImm(unsigned Opc) const override
isBranchWithImm - Return true if the branch contains an immediate operand (
MipsSEInstrInfo(const MipsSubtarget &STI)
bool expandPostRAPseudo(MachineInstr &MI) const override
void loadRegFromStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, int64_t Offset, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void storeRegToStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, int64_t Offset, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
unsigned getOppositeBranchOpc(unsigned Opc) const override
getOppositeBranchOpc - Return the inverse of the specified opcode, e.g.
const MipsSERegisterInfo & getRegisterInfo() const
bool inMicroMipsMode() const
bool isPositionIndependent() const
Wrapper class representing virtual and physical registers.
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
bool isPositionIndependent() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr MCPhysReg RA_64
constexpr MCPhysReg SP_64
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)
RegState
Flags to represent properties of register accesses.
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Kill
The last use of a register.
@ Undef
Value of the register doesn't matter.
@ Define
Register definition.
constexpr RegState getKillRegState(bool B)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
MCRegisterClass TargetRegisterClass