Lines Matching refs:MBB

64   bool expandMBB(MachineBasicBlock &MBB);
65 bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
67 bool expandMultiVecPseudo(MachineBasicBlock &MBB,
72 bool expandMOVImm(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
75 bool expand_DestructiveOp(MachineInstr &MI, MachineBasicBlock &MBB,
77 bool expandCMP_SWAP(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
81 bool expandCMP_SWAP_128(MachineBasicBlock &MBB,
84 bool expandSetTagLoop(MachineBasicBlock &MBB,
87 bool expandSVESpillFill(MachineBasicBlock &MBB,
90 bool expandCALL_RVMARKER(MachineBasicBlock &MBB,
92 bool expandCALL_BTI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI);
93 bool expandStoreSwiftAsyncContext(MachineBasicBlock &MBB,
95 MachineBasicBlock *expandRestoreZA(MachineBasicBlock &MBB,
97 MachineBasicBlock *expandCondSMToggle(MachineBasicBlock &MBB,
125 bool AArch64ExpandPseudo::expandMOVImm(MachineBasicBlock &MBB, in expandMOVImm() argument
155 MIBS.push_back(BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
163 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
176 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
187 MIBS.push_back(BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
195 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
208 MIBS.push_back(BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
219 MIBS.push_back(BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(I->Opcode)) in expandMOVImm()
236 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned LdarOp, in expandCMP_SWAP() argument
251 MachineFunction *MF = MBB.getParent(); in expandCMP_SWAP()
252 auto LoadCmpBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP()
253 auto StoreBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP()
254 auto DoneBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP()
256 MF->insert(++MBB.getIterator(), LoadCmpBB); in expandCMP_SWAP()
293 DoneBB->splice(DoneBB->end(), &MBB, MI, MBB.end()); in expandCMP_SWAP()
294 DoneBB->transferSuccessors(&MBB); in expandCMP_SWAP()
296 MBB.addSuccessor(LoadCmpBB); in expandCMP_SWAP()
298 NextMBBI = MBB.end(); in expandCMP_SWAP()
316 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, in expandCMP_SWAP_128() argument
356 MachineFunction *MF = MBB.getParent(); in expandCMP_SWAP_128()
357 auto LoadCmpBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP_128()
358 auto StoreBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP_128()
359 auto FailBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP_128()
360 auto DoneBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandCMP_SWAP_128()
362 MF->insert(++MBB.getIterator(), LoadCmpBB); in expandCMP_SWAP_128()
425 DoneBB->splice(DoneBB->end(), &MBB, MI, MBB.end()); in expandCMP_SWAP_128()
426 DoneBB->transferSuccessors(&MBB); in expandCMP_SWAP_128()
428 MBB.addSuccessor(LoadCmpBB); in expandCMP_SWAP_128()
430 NextMBBI = MBB.end(); in expandCMP_SWAP_128()
491 MachineBasicBlock &MBB, in expand_DestructiveOp() argument
616 PRFX = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(MovPrfxZero)) in expand_DestructiveOp()
631 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(LSLZero)) in expand_DestructiveOp()
639 PRFX = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(MovPrfx)) in expand_DestructiveOp()
648 DOP = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(Opcode)) in expand_DestructiveOp()
674 finalizeBundle(MBB, PRFX->getIterator(), MBBI->getIterator()); in expand_DestructiveOp()
684 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, in expandSetTagLoop() argument
691 MachineFunction *MF = MBB.getParent(); in expandSetTagLoop()
702 BuildMI(MBB, MBBI, DL, TII->get(OpCode1), AddressReg) in expandSetTagLoop()
709 BuildMI(MBB, MBBI, DL, TII->get(AArch64::MOVi64imm), SizeReg) in expandSetTagLoop()
711 expandMOVImm(MBB, I, 64); in expandSetTagLoop()
713 auto LoopBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandSetTagLoop()
714 auto DoneBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock()); in expandSetTagLoop()
716 MF->insert(++MBB.getIterator(), LoopBB); in expandSetTagLoop()
739 DoneBB->splice(DoneBB->end(), &MBB, MI, MBB.end()); in expandSetTagLoop()
740 DoneBB->transferSuccessors(&MBB); in expandSetTagLoop()
742 MBB.addSuccessor(LoopBB); in expandSetTagLoop()
744 NextMBBI = MBB.end(); in expandSetTagLoop()
760 bool AArch64ExpandPseudo::expandSVESpillFill(MachineBasicBlock &MBB, in expandSVESpillFill() argument
773 MBB.getParent()->getSubtarget().getRegisterInfo(); in expandSVESpillFill()
780 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(Opc)) in expandSVESpillFill()
792 static MachineInstr *createCallWithOps(MachineBasicBlock &MBB, in createCallWithOps() argument
799 MachineInstr *Call = BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII->get(Opcode)) in createCallWithOps()
823 static MachineInstr *createCall(MachineBasicBlock &MBB, in createCall() argument
832 return createCallWithOps(MBB, MBBI, TII, Opc, CallTarget, RegMaskStartIdx); in createCall()
836 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) { in expandCALL_RVMARKER() argument
861 OriginalCall = createCallWithOps(MBB, MBBI, TII, AArch64::BLRA, Ops, in expandCALL_RVMARKER()
865 OriginalCall = createCall(MBB, MBBI, TII, MI.getOperand(1), in expandCALL_RVMARKER()
870 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ORRXrs)) in expandCALL_RVMARKER()
876 auto *RVCall = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::BL)) in expandCALL_RVMARKER()
881 MBB.getParent()->moveCallSiteInfo(&MI, OriginalCall); in expandCALL_RVMARKER()
884 finalizeBundle(MBB, OriginalCall->getIterator(), in expandCALL_RVMARKER()
889 bool AArch64ExpandPseudo::expandCALL_BTI(MachineBasicBlock &MBB, in expandCALL_BTI() argument
897 MachineInstr *Call = createCall(MBB, MBBI, TII, MI.getOperand(0), in expandCALL_BTI()
901 Call->setCFIType(*MBB.getParent(), MI.getCFIType()); in expandCALL_BTI()
904 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::HINT)) in expandCALL_BTI()
910 MBB.getParent()->moveCallSiteInfo(&MI, Call); in expandCALL_BTI()
913 finalizeBundle(MBB, Call->getIterator(), std::next(BTI->getIterator())); in expandCALL_BTI()
918 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) { in expandStoreSwiftAsyncContext() argument
923 auto &STI = MBB.getParent()->getSubtarget<AArch64Subtarget>(); in expandStoreSwiftAsyncContext()
926 BuildMI(MBB, MBBI, DL, TII->get(AArch64::STRXui)) in expandStoreSwiftAsyncContext()
943 BuildMI(MBB, MBBI, DL, TII->get(Opc), AArch64::X16) in expandStoreSwiftAsyncContext()
948 BuildMI(MBB, MBBI, DL, TII->get(AArch64::MOVKXi), AArch64::X16) in expandStoreSwiftAsyncContext()
955 BuildMI(MBB, MBBI, DL, TII->get(AArch64::ORRXrs), AArch64::X17) in expandStoreSwiftAsyncContext()
960 BuildMI(MBB, MBBI, DL, TII->get(AArch64::PACDB), AArch64::X17) in expandStoreSwiftAsyncContext()
964 BuildMI(MBB, MBBI, DL, TII->get(AArch64::STRXui)) in expandStoreSwiftAsyncContext()
975 AArch64ExpandPseudo::expandRestoreZA(MachineBasicBlock &MBB, in expandRestoreZA() argument
978 assert((std::next(MBBI) != MBB.end() || in expandRestoreZA()
985 MachineInstrBuilder Cbz = BuildMI(MBB, MBBI, DL, TII->get(AArch64::CBZX)) in expandRestoreZA()
993 MachineBasicBlock *SMBB = MBB.splitAt(PrevMI, /*UpdateLiveIns*/ true); in expandRestoreZA()
1000 BuildMI(&MBB, DL, TII->get(AArch64::B)) in expandRestoreZA()
1002 MBB.addSuccessor(EndBB); in expandRestoreZA()
1017 AArch64ExpandPseudo::expandCondSMToggle(MachineBasicBlock &MBB, in expandCondSMToggle() argument
1025 if (std::next(MBBI) == MBB.end() && in expandCondSMToggle()
1029 return &MBB; in expandCondSMToggle()
1082 auto TRI = MBB.getParent()->getSubtarget().getRegisterInfo(); in expandCondSMToggle()
1085 BuildMI(MBB, MBBI, DL, TII->get(Opc)).addReg(SMReg32).addImm(0); in expandCondSMToggle()
1092 MachineBasicBlock *SMBB = MBB.splitAt(PrevMI, /*UpdateLiveIns*/ true); in expandCondSMToggle()
1099 BuildMI(&MBB, DL, TII->get(AArch64::B)) in expandCondSMToggle()
1101 MBB.addSuccessor(EndBB); in expandCondSMToggle()
1121 MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, in expandMultiVecPseudo() argument
1137 MachineInstrBuilder MIB = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(Opc)) in expandMultiVecPseudo()
1149 bool AArch64ExpandPseudo::expandMI(MachineBasicBlock &MBB, in expandMI() argument
1161 return expand_DestructiveOp(MI, MBB, MBBI); in expandMI()
1174 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1183 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1193 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1201 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1209 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1277 MachineFunction &MF = *MBB.getParent(); in expandMI()
1281 MBB.insert(MBBI, NewMI); in expandMI()
1296 MachineFunction *MF = MBB.getParent(); in expandMI()
1303 MachineInstrBuilder MIB = BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1320 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ADRP), DstReg); in expandMI()
1324 auto TRI = MBB.getParent()->getSubtarget().getRegisterInfo(); in expandMI()
1327 MIB2 = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::LDRWui)) in expandMI()
1333 MIB2 = BuildMI(MBB, MBBI, DL, TII->get(AArch64::LDRXui)) in expandMI()
1376 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ADRP), DstReg) in expandMI()
1378 auto MIB2 = BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1398 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ADRP), DstReg) in expandMI()
1412 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::MOVKXi), DstReg) in expandMI()
1419 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ADDXri)) in expandMI()
1431 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::ADDXri)) in expandMI()
1442 MachineFunction *MF = MBB.getParent(); in expandMI()
1451 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::MRS), DstReg) in expandMI()
1458 return expandMOVImm(MBB, MBBI, 32); in expandMI()
1460 return expandMOVImm(MBB, MBBI, 64); in expandMI()
1468 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::RET)) in expandMI()
1475 return expandCMP_SWAP(MBB, MBBI, AArch64::LDAXRB, AArch64::STLXRB, in expandMI()
1480 return expandCMP_SWAP(MBB, MBBI, AArch64::LDAXRH, AArch64::STLXRH, in expandMI()
1485 return expandCMP_SWAP(MBB, MBBI, AArch64::LDAXRW, AArch64::STLXRW, in expandMI()
1490 return expandCMP_SWAP(MBB, MBBI, in expandMI()
1498 return expandCMP_SWAP_128(MBB, MBBI, NextMBBI); in expandMI()
1503 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1513 MachineFunction &MF = *MBB.getParent(); in expandMI()
1531 emitFrameOffset(MBB, &MI, MI.getDebugLoc(), SrcReg, FrameReg, in expandMI()
1534 BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::IRG)) in expandMI()
1543 BuildMI(MBB, MBBI, MI.getDebugLoc(), in expandMI()
1554 return expandSetTagLoop(MBB, MBBI, NextMBBI); in expandMI()
1561 return expandSVESpillFill(MBB, MBBI, AArch64::STR_ZXI, 4); in expandMI()
1563 return expandSVESpillFill(MBB, MBBI, AArch64::STR_ZXI, 3); in expandMI()
1565 return expandSVESpillFill(MBB, MBBI, AArch64::STR_ZXI, 2); in expandMI()
1567 return expandSVESpillFill(MBB, MBBI, AArch64::STR_PXI, 2); in expandMI()
1569 return expandSVESpillFill(MBB, MBBI, AArch64::LDR_ZXI, 4); in expandMI()
1571 return expandSVESpillFill(MBB, MBBI, AArch64::LDR_ZXI, 3); in expandMI()
1573 return expandSVESpillFill(MBB, MBBI, AArch64::LDR_ZXI, 2); in expandMI()
1575 return expandSVESpillFill(MBB, MBBI, AArch64::LDR_PXI, 2); in expandMI()
1578 return expandCALL_RVMARKER(MBB, MBBI); in expandMI()
1580 return expandCALL_BTI(MBB, MBBI); in expandMI()
1582 return expandStoreSwiftAsyncContext(MBB, MBBI); in expandMI()
1584 auto *NewMBB = expandRestoreZA(MBB, MBBI); in expandMI()
1585 if (NewMBB != &MBB) in expandMI()
1586 NextMBBI = MBB.end(); // The NextMBBI iterator is invalidated. in expandMI()
1590 auto *NewMBB = expandCondSMToggle(MBB, MBBI); in expandMI()
1591 if (NewMBB != &MBB) in expandMI()
1592 NextMBBI = MBB.end(); // The NextMBBI iterator is invalidated. in expandMI()
1603 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1607 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1611 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1615 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1619 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1623 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1627 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1631 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1634 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR2RegClass, in expandMI()
1638 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR2RegClass, in expandMI()
1642 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR2RegClass, in expandMI()
1646 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR2RegClass, in expandMI()
1651 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1655 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1659 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1663 MBB, MBBI, AArch64::ZPR2RegClass, AArch64::ZPR2StridedRegClass, in expandMI()
1667 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1671 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1675 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1679 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1683 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1687 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1691 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1695 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1698 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR4RegClass, in expandMI()
1702 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR4RegClass, in expandMI()
1706 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR4RegClass, in expandMI()
1710 return expandMultiVecPseudo(MBB, MBBI, AArch64::ZPR4RegClass, in expandMI()
1715 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1719 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1723 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1727 MBB, MBBI, AArch64::ZPR4RegClass, AArch64::ZPR4StridedRegClass, in expandMI()
1735 bool AArch64ExpandPseudo::expandMBB(MachineBasicBlock &MBB) { in expandMBB() argument
1738 MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end(); in expandMBB()
1741 Modified |= expandMI(MBB, MBBI, NMBBI); in expandMBB()
1752 for (auto &MBB : MF) in runOnMachineFunction() local
1753 Modified |= expandMBB(MBB); in runOnMachineFunction()