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