Lines Matching defs:MBB
59 bool expandMBB(MachineBasicBlock &MBB);
60 bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
62 bool expandPcalau12iInstPair(MachineBasicBlock &MBB,
67 bool expandLargeAddressLoad(MachineBasicBlock &MBB,
71 bool expandLargeAddressLoad(MachineBasicBlock &MBB,
77 bool expandLoadAddressPcrel(MachineBasicBlock &MBB,
81 bool expandLoadAddressGot(MachineBasicBlock &MBB,
85 bool expandLoadAddressTLSLE(MachineBasicBlock &MBB,
88 bool expandLoadAddressTLSIE(MachineBasicBlock &MBB,
92 bool expandLoadAddressTLSLD(MachineBasicBlock &MBB,
96 bool expandLoadAddressTLSGD(MachineBasicBlock &MBB,
100 bool expandLoadAddressTLSDesc(MachineBasicBlock &MBB,
104 bool expandFunctionCALL(MachineBasicBlock &MBB,
108 void annotateTableJump(MachineBasicBlock &MBB,
118 for (auto &MBB : MF)
119 Modified |= expandMBB(MBB);
123 bool LoongArchPreRAExpandPseudo::expandMBB(MachineBasicBlock &MBB) {
126 MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
129 Modified |= expandMI(MBB, MBBI, NMBBI);
137 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
141 return expandLoadAddressPcrel(MBB, MBBI, NextMBBI);
143 return expandLoadAddressPcrel(MBB, MBBI, NextMBBI, /*Large=*/true);
145 return expandLoadAddressGot(MBB, MBBI, NextMBBI);
147 return expandLoadAddressGot(MBB, MBBI, NextMBBI, /*Large=*/true);
149 return expandLoadAddressTLSLE(MBB, MBBI, NextMBBI);
151 return expandLoadAddressTLSIE(MBB, MBBI, NextMBBI);
153 return expandLoadAddressTLSIE(MBB, MBBI, NextMBBI, /*Large=*/true);
155 return expandLoadAddressTLSLD(MBB, MBBI, NextMBBI);
157 return expandLoadAddressTLSLD(MBB, MBBI, NextMBBI, /*Large=*/true);
159 return expandLoadAddressTLSGD(MBB, MBBI, NextMBBI);
161 return expandLoadAddressTLSGD(MBB, MBBI, NextMBBI, /*Large=*/true);
163 return expandLoadAddressTLSDesc(MBB, MBBI, NextMBBI);
165 return expandLoadAddressTLSDesc(MBB, MBBI, NextMBBI, /*Large=*/true);
168 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/false);
171 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/true);
176 annotateTableJump(MBB, MBBI);
183 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
186 MachineFunction *MF = MBB.getParent();
198 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), ScratchReg)
202 BuildMI(MBB, MBBI, DL, TII->get(SecondOpcode), DestReg)
214 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
218 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LastOpcode, IdentifyingMO,
224 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
263 MachineFunction *MF = MBB.getParent();
285 auto Part1 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), TmpPart1);
286 auto Part0 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADDI_D), TmpPart0)
288 auto Part2 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), TmpParts02)
291 auto Part3 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), TmpParts023)
293 BuildMI(MBB, MBBI, DL, TII->get(LastOpcode), DestReg)
317 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
322 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
328 MachineFunction *MF = MBB.getParent();
331 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_PCREL_HI,
336 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
341 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::LDX_D,
347 MachineFunction *MF = MBB.getParent();
350 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_GOT_PC_HI,
355 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
367 MachineFunction *MF = MBB.getParent();
380 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU12I_W), Part1)
386 BuildMI(MBB, MBBI, DL, TII->get(AddOp), Parts01)
392 BuildMI(MBB, MBBI, DL, TII->get(AddiOp), DestReg)
396 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU12I_W), Part1)
399 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ORI), Parts01)
406 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), Parts012)
410 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), DestReg)
420 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
425 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::LDX_D,
431 MachineFunction *MF = MBB.getParent();
434 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_IE_PC_HI,
439 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
444 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
450 MachineFunction *MF = MBB.getParent();
453 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_LD_PC_HI,
458 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
463 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
469 MachineFunction *MF = MBB.getParent();
472 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_GD_PC_HI,
477 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
479 MachineFunction *MF = MBB.getParent();
494 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), Tmp1Reg)
510 assert(MBB.getParent()->getSubtarget<LoongArchSubtarget>().is64Bit() &&
518 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADDI_D), Tmp2Reg)
521 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), Tmp3Reg)
524 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), Tmp4Reg)
527 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADD_D), LoongArch::R4)
537 BuildMI(MBB, MBBI, DL, TII->get(ADDI), LoongArch::R4)
544 BuildMI(MBB, MBBI, DL, TII->get(LD), LoongArch::R1)
549 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PseudoDESC_CALL), LoongArch::R1)
554 BuildMI(MBB, MBBI, DL, TII->get(ADD), DestReg)
563 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
565 MachineFunction *MF = MBB.getParent();
582 CALL = BuildMI(MBB, MBBI, DL, TII->get(Opcode)).add(Func);
599 expandLargeAddressLoad(MBB, MBBI, NextMBBI, LAOpcode, MO, Func, AddrReg,
601 CALL = BuildMI(MBB, MBBI, DL, TII->get(Opcode)).addReg(AddrReg).addImm(0);
617 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) {
618 MachineFunction *MF = MBB.getParent();
619 MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
670 bool expandMBB(MachineBasicBlock &MBB);
671 bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
673 bool expandCopyCFR(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
675 bool expandFunctionCALL(MachineBasicBlock &MBB,
688 for (auto &MBB : MF)
689 Modified |= expandMBB(MBB);
694 bool LoongArchExpandPseudo::expandMBB(MachineBasicBlock &MBB) {
697 MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
700 Modified |= expandMI(MBB, MBBI, NMBBI);
707 bool LoongArchExpandPseudo::expandMI(MachineBasicBlock &MBB,
712 return expandCopyCFR(MBB, MBBI, NextMBBI);
714 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/false);
716 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/true);
723 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
725 MachineFunction *MF = MBB.getParent();
730 // MBB:
738 const BasicBlock *LLVM_BB = MBB.getBasicBlock();
742 MF->insert(++MBB.getIterator(), FalseBB);
748 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::SET_CFR_FALSE), DestReg);
750 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::BCEQZ))
758 SinkBB->splice(SinkBB->end(), &MBB, MI, MBB.end());
759 SinkBB->transferSuccessors(&MBB);
761 MBB.addSuccessor(FalseBB);
762 MBB.addSuccessor(SinkBB);
764 NextMBBI = MBB.end();
776 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
778 MachineFunction *MF = MBB.getParent();
800 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCADDU18I), ScratchReg);
803 BuildMI(MBB, MBBI, DL, TII->get(Opcode)).addReg(ScratchReg).addImm(0);