Lines Matching defs:MBB

57   bool expandMBB(MachineBasicBlock &MBB);
58 bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
60 bool expandPcalau12iInstPair(MachineBasicBlock &MBB,
65 bool expandLoadAddressPcrel(MachineBasicBlock &MBB,
68 bool expandLoadAddressGot(MachineBasicBlock &MBB,
71 bool expandLoadAddressTLSLE(MachineBasicBlock &MBB,
74 bool expandLoadAddressTLSIE(MachineBasicBlock &MBB,
77 bool expandLoadAddressTLSLD(MachineBasicBlock &MBB,
80 bool expandLoadAddressTLSGD(MachineBasicBlock &MBB,
83 bool expandLoadAddressTLSDesc(MachineBasicBlock &MBB,
94 for (auto &MBB : MF)
95 Modified |= expandMBB(MBB);
99 bool LoongArchPreRAExpandPseudo::expandMBB(MachineBasicBlock &MBB) {
102 MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
105 Modified |= expandMI(MBB, MBBI, NMBBI);
113 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
117 return expandLoadAddressPcrel(MBB, MBBI, NextMBBI);
119 return expandLoadAddressGot(MBB, MBBI, NextMBBI);
121 return expandLoadAddressTLSLE(MBB, MBBI, NextMBBI);
123 return expandLoadAddressTLSIE(MBB, MBBI, NextMBBI);
125 return expandLoadAddressTLSLD(MBB, MBBI, NextMBBI);
127 return expandLoadAddressTLSGD(MBB, MBBI, NextMBBI);
129 return expandLoadAddressTLSDesc(MBB, MBBI, NextMBBI);
135 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
138 MachineFunction *MF = MBB.getParent();
147 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), ScratchReg)
151 BuildMI(MBB, MBBI, DL, TII->get(SecondOpcode), DestReg)
163 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
168 MachineFunction *MF = MBB.getParent();
171 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_PCREL_HI,
176 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
181 MachineFunction *MF = MBB.getParent();
184 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_GOT_PC_HI,
189 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
199 MachineFunction *MF = MBB.getParent();
212 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU12I_W), Part1)
215 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ORI), Parts01)
223 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), Parts012)
227 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), DestReg)
237 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
242 MachineFunction *MF = MBB.getParent();
245 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_IE_PC_HI,
250 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
255 MachineFunction *MF = MBB.getParent();
258 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_LD_PC_HI,
263 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
268 MachineFunction *MF = MBB.getParent();
271 return expandPcalau12iInstPair(MBB, MBBI, NextMBBI, LoongArchII::MO_GD_PC_HI,
276 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
284 MachineFunction *MF = MBB.getParent();
298 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), ScratchReg)
301 BuildMI(MBB, MBBI, DL, TII->get(ADDI), LoongArch::R4)
305 BuildMI(MBB, MBBI, DL, TII->get(LD), LoongArch::R1)
309 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PseudoDESC_CALL), LoongArch::R1)
313 BuildMI(MBB, MBBI, DL, TII->get(ADD), DestReg)
337 bool expandMBB(MachineBasicBlock &MBB);
338 bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
340 bool expandCopyCFR(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
342 bool expandLargeAddressLoad(MachineBasicBlock &MBB,
346 bool expandLargeAddressLoad(MachineBasicBlock &MBB,
352 bool expandLoadAddressPcrelLarge(MachineBasicBlock &MBB,
355 bool expandLoadAddressGotLarge(MachineBasicBlock &MBB,
358 bool expandLoadAddressTLSIELarge(MachineBasicBlock &MBB,
361 bool expandLoadAddressTLSLDLarge(MachineBasicBlock &MBB,
364 bool expandLoadAddressTLSGDLarge(MachineBasicBlock &MBB,
367 bool expandLoadAddressTLSDescPcLarge(MachineBasicBlock &MBB,
370 bool expandFunctionCALL(MachineBasicBlock &MBB,
383 for (auto &MBB : MF)
384 Modified |= expandMBB(MBB);
389 bool LoongArchExpandPseudo::expandMBB(MachineBasicBlock &MBB) {
392 MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
395 Modified |= expandMI(MBB, MBBI, NMBBI);
402 bool LoongArchExpandPseudo::expandMI(MachineBasicBlock &MBB,
407 return expandCopyCFR(MBB, MBBI, NextMBBI);
409 return expandLoadAddressPcrelLarge(MBB, MBBI, NextMBBI);
411 return expandLoadAddressGotLarge(MBB, MBBI, NextMBBI);
413 return expandLoadAddressTLSIELarge(MBB, MBBI, NextMBBI);
415 return expandLoadAddressTLSLDLarge(MBB, MBBI, NextMBBI);
417 return expandLoadAddressTLSGDLarge(MBB, MBBI, NextMBBI);
419 return expandLoadAddressTLSDescPcLarge(MBB, MBBI, NextMBBI);
423 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/false);
427 return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/true);
434 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
436 MachineFunction *MF = MBB.getParent();
441 // MBB:
449 const BasicBlock *LLVM_BB = MBB.getBasicBlock();
453 MF->insert(++MBB.getIterator(), FalseBB);
459 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::SET_CFR_FALSE), DestReg);
461 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::BCEQZ))
469 SinkBB->splice(SinkBB->end(), &MBB, MI, MBB.end());
470 SinkBB->transferSuccessors(&MBB);
472 MBB.addSuccessor(FalseBB);
473 MBB.addSuccessor(SinkBB);
475 NextMBBI = MBB.end();
487 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
491 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LastOpcode, IdentifyingMO,
497 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
540 assert(MBB.getParent()->getSubtarget<LoongArchSubtarget>().is64Bit() &&
543 auto Part1 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), DestReg);
544 auto Part0 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADDI_D), ScratchReg)
546 auto Part2 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), ScratchReg)
549 auto Part3 = BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), ScratchReg)
551 BuildMI(MBB, MBBI, DL, TII->get(LastOpcode), DestReg)
575 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
579 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
584 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
588 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::LDX_D,
593 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
597 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::LDX_D,
602 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
606 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
611 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
615 return expandLargeAddressLoad(MBB, MBBI, NextMBBI, LoongArch::ADD_D,
620 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
639 assert(MBB.getParent()->getSubtarget<LoongArchSubtarget>().is64Bit() &&
642 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCALAU12I), LoongArch::R4)
644 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADDI_D), ScratchReg)
647 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU32I_D), ScratchReg)
650 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LU52I_D), ScratchReg)
653 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADD_D), LoongArch::R4)
656 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::LD_D), LoongArch::R1)
659 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PseudoDESC_CALL), LoongArch::R1)
662 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::ADD_D), DestReg)
672 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
674 MachineFunction *MF = MBB.getParent();
691 CALL = BuildMI(MBB, MBBI, DL, TII->get(Opcode)).add(Func);
705 BuildMI(MBB, MBBI, DL, TII->get(LoongArch::PCADDU18I), ScratchReg);
708 BuildMI(MBB, MBBI, DL, TII->get(Opcode)).addReg(ScratchReg).addImm(0);
727 expandLargeAddressLoad(MBB, MBBI, NextMBBI, LAOpcode, MO, Func, AddrReg,
729 CALL = BuildMI(MBB, MBBI, DL, TII->get(Opcode)).addReg(AddrReg).addImm(0);