• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/AVR/

Lines Matching refs:MBBI

61   bool expandMI(Block &MBB, BlockIt MBBI);
62 template <unsigned OP> bool expand(Block &MBB, BlockIt MBBI);
64 MachineInstrBuilder buildMI(Block &MBB, BlockIt MBBI, unsigned Opcode) {
65 return BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII->get(Opcode));
68 MachineInstrBuilder buildMI(Block &MBB, BlockIt MBBI, unsigned Opcode,
70 return BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII->get(Opcode), DstReg);
75 bool expandArith(unsigned OpLo, unsigned OpHi, Block &MBB, BlockIt MBBI);
76 bool expandLogic(unsigned Op, Block &MBB, BlockIt MBBI);
77 bool expandLogicImm(unsigned Op, Block &MBB, BlockIt MBBI);
81 bool expandAtomic(Block &MBB, BlockIt MBBI, Func f);
84 bool expandAtomicBinaryOp(unsigned Opcode, Block &MBB, BlockIt MBBI, Func f);
86 bool expandAtomicBinaryOp(unsigned Opcode, Block &MBB, BlockIt MBBI);
91 BlockIt MBBI);
102 BlockIt MBBI = MBB.begin(), E = MBB.end();
103 while (MBBI != E) {
104 BlockIt NMBBI = std::next(MBBI);
105 Modified |= expandMI(MBB, MBBI);
106 MBBI = NMBBI;
142 expandArith(unsigned OpLo, unsigned OpHi, Block &MBB, BlockIt MBBI) {
143 MachineInstr &MI = *MBBI;
154 buildMI(MBB, MBBI, OpLo)
159 auto MIBHI = buildMI(MBB, MBBI, OpHi)
175 expandLogic(unsigned Op, Block &MBB, BlockIt MBBI) {
176 MachineInstr &MI = *MBBI;
187 auto MIBLO = buildMI(MBB, MBBI, Op)
195 auto MIBHI = buildMI(MBB, MBBI, Op)
222 expandLogicImm(unsigned Op, Block &MBB, BlockIt MBBI) {
223 MachineInstr &MI = *MBBI;
235 auto MIBLO = buildMI(MBB, MBBI, Op)
245 auto MIBHI = buildMI(MBB, MBBI, Op)
259 bool AVRExpandPseudo::expand<AVR::ADDWRdRr>(Block &MBB, BlockIt MBBI) {
260 return expandArith(AVR::ADDRdRr, AVR::ADCRdRr, MBB, MBBI);
264 bool AVRExpandPseudo::expand<AVR::ADCWRdRr>(Block &MBB, BlockIt MBBI) {
265 return expandArith(AVR::ADCRdRr, AVR::ADCRdRr, MBB, MBBI);
269 bool AVRExpandPseudo::expand<AVR::SUBWRdRr>(Block &MBB, BlockIt MBBI) {
270 return expandArith(AVR::SUBRdRr, AVR::SBCRdRr, MBB, MBBI);
274 bool AVRExpandPseudo::expand<AVR::SUBIWRdK>(Block &MBB, BlockIt MBBI) {
275 MachineInstr &MI = *MBBI;
283 auto MIBLO = buildMI(MBB, MBBI, AVR::SUBIRdK)
287 auto MIBHI = buildMI(MBB, MBBI, AVR::SBCIRdK)
321 bool AVRExpandPseudo::expand<AVR::SBCWRdRr>(Block &MBB, BlockIt MBBI) {
322 return expandArith(AVR::SBCRdRr, AVR::SBCRdRr, MBB, MBBI);
326 bool AVRExpandPseudo::expand<AVR::SBCIWRdK>(Block &MBB, BlockIt MBBI) {
327 MachineInstr &MI = *MBBI;
340 auto MIBLO = buildMI(MBB, MBBI, OpLo)
348 auto MIBHI = buildMI(MBB, MBBI, OpHi)
364 bool AVRExpandPseudo::expand<AVR::ANDWRdRr>(Block &MBB, BlockIt MBBI) {
365 return expandLogic(AVR::ANDRdRr, MBB, MBBI);
369 bool AVRExpandPseudo::expand<AVR::ANDIWRdK>(Block &MBB, BlockIt MBBI) {
370 return expandLogicImm(AVR::ANDIRdK, MBB, MBBI);
374 bool AVRExpandPseudo::expand<AVR::ORWRdRr>(Block &MBB, BlockIt MBBI) {
375 return expandLogic(AVR::ORRdRr, MBB, MBBI);
379 bool AVRExpandPseudo::expand<AVR::ORIWRdK>(Block &MBB, BlockIt MBBI) {
380 return expandLogicImm(AVR::ORIRdK, MBB, MBBI);
384 bool AVRExpandPseudo::expand<AVR::EORWRdRr>(Block &MBB, BlockIt MBBI) {
385 return expandLogic(AVR::EORRdRr, MBB, MBBI);
389 bool AVRExpandPseudo::expand<AVR::COMWRd>(Block &MBB, BlockIt MBBI) {
390 MachineInstr &MI = *MBBI;
400 auto MIBLO = buildMI(MBB, MBBI, OpLo)
407 auto MIBHI = buildMI(MBB, MBBI, OpHi)
419 bool AVRExpandPseudo::expand<AVR::CPWRdRr>(Block &MBB, BlockIt MBBI) {
420 MachineInstr &MI = *MBBI;
433 buildMI(MBB, MBBI, OpLo)
437 auto MIBHI = buildMI(MBB, MBBI, OpHi)
452 bool AVRExpandPseudo::expand<AVR::CPCWRdRr>(Block &MBB, BlockIt MBBI) {
453 MachineInstr &MI = *MBBI;
465 auto MIBLO = buildMI(MBB, MBBI, OpLo)
472 auto MIBHI = buildMI(MBB, MBBI, OpHi)
487 bool AVRExpandPseudo::expand<AVR::LDIWRdK>(Block &MBB, BlockIt MBBI) {
488 MachineInstr &MI = *MBBI;
496 auto MIBLO = buildMI(MBB, MBBI, OpLo)
499 auto MIBHI = buildMI(MBB, MBBI, OpHi)
536 bool AVRExpandPseudo::expand<AVR::LDSWRdK>(Block &MBB, BlockIt MBBI) {
537 MachineInstr &MI = *MBBI;
545 auto MIBLO = buildMI(MBB, MBBI, OpLo)
548 auto MIBHI = buildMI(MBB, MBBI, OpHi)
580 bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {
581 MachineInstr &MI = *MBBI;
599 auto MIBLO = buildMI(MBB, MBBI, OpLo)
605 buildMI(MBB, MBBI, AVR::PUSHRr).addReg(TmpReg);
608 auto MIBHI = buildMI(MBB, MBBI, OpHi)
615 buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
618 buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
629 bool AVRExpandPseudo::expand<AVR::LDWRdPtrPi>(Block &MBB, BlockIt MBBI) {
630 MachineInstr &MI = *MBBI;
642 auto MIBLO = buildMI(MBB, MBBI, OpLo)
647 auto MIBHI = buildMI(MBB, MBBI, OpHi)
660 bool AVRExpandPseudo::expand<AVR::LDWRdPtrPd>(Block &MBB, BlockIt MBBI) {
661 MachineInstr &MI = *MBBI;
673 auto MIBHI = buildMI(MBB, MBBI, OpHi)
678 auto MIBLO = buildMI(MBB, MBBI, OpLo)
691 bool AVRExpandPseudo::expand<AVR::LDDWRdPtrQ>(Block &MBB, BlockIt MBBI) {
692 MachineInstr &MI = *MBBI;
715 auto MIBLO = buildMI(MBB, MBBI, OpLo)
722 buildMI(MBB, MBBI, AVR::PUSHRr).addReg(TmpReg);
725 auto MIBHI = buildMI(MBB, MBBI, OpHi)
732 buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
735 buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
746 bool AVRExpandPseudo::expand<AVR::LPMWRdZ>(Block &MBB, BlockIt MBBI) {
747 MachineInstr &MI = *MBBI;
765 auto MIBLO = buildMI(MBB, MBBI, OpLo)
771 buildMI(MBB, MBBI, AVR::PUSHRr).addReg(TmpReg);
774 auto MIBHI = buildMI(MBB, MBBI, OpHi)
780 buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
783 buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
794 bool AVRExpandPseudo::expand<AVR::LPMWRdZPi>(Block &MBB, BlockIt MBBI) {
799 bool AVRExpandPseudo::expandAtomic(Block &MBB, BlockIt MBBI, Func f) {
801 MachineInstr &MI = *MBBI;
804 buildMI(MBB, MBBI, AVR::INRdA)
809 buildMI(MBB, MBBI, AVR::BCLRs).addImm(7); // CLI
814 buildMI(MBB, MBBI, AVR::OUTARr)
825 BlockIt MBBI,
827 return expandAtomic(MBB, MBBI, [&](MachineInstr &MI) {
832 *buildMI(MBB, MBBI, Opcode).add(Op1).add(Op2).getInstr();
839 BlockIt MBBI) {
840 return expandAtomicBinaryOp(Opcode, MBB, MBBI, [](MachineInstr &MI) {});
846 BlockIt MBBI) {
847 return expandAtomic(MBB, MBBI, [&](MachineInstr &MI) {
855 buildMI(MBB, MBBI, LoadOpcode).add(Op1).add(Op2);
858 buildMI(MBB, MBBI, ArithOpcode).add(Op1).add(Op1).add(Op2);
861 buildMI(MBB, MBBI, StoreOpcode).add(Op2).add(Op1);
892 bool AVRExpandPseudo::expand<AVR::AtomicLoad8>(Block &MBB, BlockIt MBBI) {
893 return expandAtomicBinaryOp(AVR::LDRdPtr, MBB, MBBI);
897 bool AVRExpandPseudo::expand<AVR::AtomicLoad16>(Block &MBB, BlockIt MBBI) {
898 return expandAtomicBinaryOp(AVR::LDWRdPtr, MBB, MBBI);
902 bool AVRExpandPseudo::expand<AVR::AtomicStore8>(Block &MBB, BlockIt MBBI) {
903 return expandAtomicBinaryOp(AVR::STPtrRr, MBB, MBBI);
907 bool AVRExpandPseudo::expand<AVR::AtomicStore16>(Block &MBB, BlockIt MBBI) {
908 return expandAtomicBinaryOp(AVR::STWPtrRr, MBB, MBBI);
912 bool AVRExpandPseudo::expand<AVR::AtomicLoadAdd8>(Block &MBB, BlockIt MBBI) {
913 return expandAtomicArithmeticOp(8, AVR::ADDRdRr, MBB, MBBI);
917 bool AVRExpandPseudo::expand<AVR::AtomicLoadAdd16>(Block &MBB, BlockIt MBBI) {
918 return expandAtomicArithmeticOp(16, AVR::ADDWRdRr, MBB, MBBI);
922 bool AVRExpandPseudo::expand<AVR::AtomicLoadSub8>(Block &MBB, BlockIt MBBI) {
923 return expandAtomicArithmeticOp(8, AVR::SUBRdRr, MBB, MBBI);
927 bool AVRExpandPseudo::expand<AVR::AtomicLoadSub16>(Block &MBB, BlockIt MBBI) {
928 return expandAtomicArithmeticOp(16, AVR::SUBWRdRr, MBB, MBBI);
932 bool AVRExpandPseudo::expand<AVR::AtomicLoadAnd8>(Block &MBB, BlockIt MBBI) {
933 return expandAtomicArithmeticOp(8, AVR::ANDRdRr, MBB, MBBI);
937 bool AVRExpandPseudo::expand<AVR::AtomicLoadAnd16>(Block &MBB, BlockIt MBBI) {
938 return expandAtomicArithmeticOp(16, AVR::ANDWRdRr, MBB, MBBI);
942 bool AVRExpandPseudo::expand<AVR::AtomicLoadOr8>(Block &MBB, BlockIt MBBI) {
943 return expandAtomicArithmeticOp(8, AVR::ORRdRr, MBB, MBBI);
947 bool AVRExpandPseudo::expand<AVR::AtomicLoadOr16>(Block &MBB, BlockIt MBBI) {
948 return expandAtomicArithmeticOp(16, AVR::ORWRdRr, MBB, MBBI);
952 bool AVRExpandPseudo::expand<AVR::AtomicLoadXor8>(Block &MBB, BlockIt MBBI) {
953 return expandAtomicArithmeticOp(8, AVR::EORRdRr, MBB, MBBI);
957 bool AVRExpandPseudo::expand<AVR::AtomicLoadXor16>(Block &MBB, BlockIt MBBI) {
958 return expandAtomicArithmeticOp(16, AVR::EORWRdRr, MBB, MBBI);
962 bool AVRExpandPseudo::expand<AVR::AtomicFence>(Block &MBB, BlockIt MBBI) {
964 MBBI->eraseFromParent();
969 bool AVRExpandPseudo::expand<AVR::STSWKRr>(Block &MBB, BlockIt MBBI) {
970 MachineInstr &MI = *MBBI;
980 auto MIBHI = buildMI(MBB, MBBI, OpHi);
981 auto MIBLO = buildMI(MBB, MBBI, OpLo);
1015 bool AVRExpandPseudo::expand<AVR::STWPtrRr>(Block &MBB, BlockIt MBBI) {
1016 MachineInstr &MI = *MBBI;
1026 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1030 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1043 bool AVRExpandPseudo::expand<AVR::STWPtrPiRr>(Block &MBB, BlockIt MBBI) {
1044 MachineInstr &MI = *MBBI;
1057 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1063 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1077 bool AVRExpandPseudo::expand<AVR::STWPtrPdRr>(Block &MBB, BlockIt MBBI) {
1078 MachineInstr &MI = *MBBI;
1091 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1097 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1111 bool AVRExpandPseudo::expand<AVR::STDWPtrQRr>(Block &MBB, BlockIt MBBI) {
1112 MachineInstr &MI = *MBBI;
1127 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1132 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1145 bool AVRExpandPseudo::expand<AVR::INWRdA>(Block &MBB, BlockIt MBBI) {
1146 MachineInstr &MI = *MBBI;
1159 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1163 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1175 bool AVRExpandPseudo::expand<AVR::OUTWARr>(Block &MBB, BlockIt MBBI) {
1176 MachineInstr &MI = *MBBI;
1190 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1194 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1206 bool AVRExpandPseudo::expand<AVR::PUSHWRr>(Block &MBB, BlockIt MBBI) {
1207 MachineInstr &MI = *MBBI;
1217 buildMI(MBB, MBBI, OpLo)
1222 buildMI(MBB, MBBI, OpHi)
1231 bool AVRExpandPseudo::expand<AVR::POPWRd>(Block &MBB, BlockIt MBBI) {
1232 MachineInstr &MI = *MBBI;
1240 buildMI(MBB, MBBI, OpHi, DstHiReg).setMIFlags(Flags); // High
1241 buildMI(MBB, MBBI, OpLo, DstLoReg).setMIFlags(Flags); // Low
1248 bool AVRExpandPseudo::expand<AVR::ROLBRd>(Block &MBB, BlockIt MBBI) {
1255 MachineInstr &MI = *MBBI;
1266 buildMI(MBB, MBBI, OpShift)
1272 auto MIB = buildMI(MBB, MBBI, OpCarry)
1285 bool AVRExpandPseudo::expand<AVR::RORBRd>(Block &MBB, BlockIt MBBI) {
1292 MachineInstr &MI = *MBBI;
1307 buildMI(MBB, MBBI, OpShiftOut)
1312 buildMI(MBB, MBBI, OpLoad)
1317 buildMI(MBB, MBBI, OpShiftIn)
1322 auto MIB = buildMI(MBB, MBBI, OpAdd)
1335 bool AVRExpandPseudo::expand<AVR::LSLWRd>(Block &MBB, BlockIt MBBI) {
1336 MachineInstr &MI = *MBBI;
1347 buildMI(MBB, MBBI, OpLo)
1352 auto MIBHI = buildMI(MBB, MBBI, OpHi)
1368 bool AVRExpandPseudo::expand<AVR::LSRWRd>(Block &MBB, BlockIt MBBI) {
1369 MachineInstr &MI = *MBBI;
1380 buildMI(MBB, MBBI, OpHi)
1384 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1399 bool AVRExpandPseudo::expand<AVR::RORWRd>(Block &MBB, BlockIt MBBI) {
1405 bool AVRExpandPseudo::expand<AVR::ROLWRd>(Block &MBB, BlockIt MBBI) {
1411 bool AVRExpandPseudo::expand<AVR::ASRWRd>(Block &MBB, BlockIt MBBI) {
1412 MachineInstr &MI = *MBBI;
1423 buildMI(MBB, MBBI, OpHi)
1427 auto MIBLO = buildMI(MBB, MBBI, OpLo)
1441 template <> bool AVRExpandPseudo::expand<AVR::SEXT>(Block &MBB, BlockIt MBBI) {
1442 MachineInstr &MI = *MBBI;
1465 auto MOV = buildMI(MBB, MBBI, AVR::MOVRdRr)
1475 buildMI(MBB, MBBI, AVR::MOVRdRr)
1480 buildMI(MBB, MBBI, AVR::ADDRdRr) // LSL Rd <==> ADD Rd, Rr
1485 auto SBC = buildMI(MBB, MBBI, AVR::SBCRdRr)
1500 template <> bool AVRExpandPseudo::expand<AVR::ZEXT>(Block &MBB, BlockIt MBBI) {
1501 MachineInstr &MI = *MBBI;
1519 buildMI(MBB, MBBI, AVR::MOVRdRr)
1524 auto EOR = buildMI(MBB, MBBI, AVR::EORRdRr)
1537 bool AVRExpandPseudo::expand<AVR::SPREAD>(Block &MBB, BlockIt MBBI) {
1538 MachineInstr &MI = *MBBI;
1548 buildMI(MBB, MBBI, OpLo)
1554 buildMI(MBB, MBBI, OpHi)
1564 bool AVRExpandPseudo::expand<AVR::SPWRITE>(Block &MBB, BlockIt MBBI) {
1565 MachineInstr &MI = *MBBI;
1572 buildMI(MBB, MBBI, AVR::INRdA)
1577 buildMI(MBB, MBBI, AVR::BCLRs).addImm(0x07).setMIFlags(Flags);
1579 buildMI(MBB, MBBI, AVR::OUTARr)
1584 buildMI(MBB, MBBI, AVR::OUTARr)
1589 buildMI(MBB, MBBI, AVR::OUTARr)
1598 bool AVRExpandPseudo::expandMI(Block &MBB, BlockIt MBBI) {
1599 MachineInstr &MI = *MBBI;
1600 int Opcode = MBBI->getOpcode();