Lines Matching defs:LoLoop
515 void ConvertVPTBlocks(LowOverheadLoop &LoLoop);
517 MachineInstr *ExpandLoopStart(LowOverheadLoop &LoLoop);
519 void Expand(LowOverheadLoop &LoLoop);
521 void IterationCountDCE(LowOverheadLoop &LoLoop);
1344 LowOverheadLoop LoLoop(*ML, *MLI, *RDA, *TRI, *TII);
1348 if (LoLoop.Preheader)
1349 LoLoop.Start = SearchForStart(LoLoop.Preheader);
1361 LoLoop.Dec = &MI;
1363 LoLoop.End = &MI;
1365 LoLoop.End = LoLoop.Dec = &MI;
1367 LoLoop.Start = &MI;
1372 LoLoop.Revert = true;
1377 LoLoop.AnalyseMVEInst(&MI);
1382 LLVM_DEBUG(LoLoop.dump());
1383 if (!LoLoop.FoundAllComponents()) {
1388 assert(LoLoop.Start->getOpcode() != ARM::t2WhileLoopStart &&
1394 if (LoLoop.Dec != LoLoop.End) {
1396 RDA->getReachingLocalUses(LoLoop.Dec, MCRegister::from(ARM::LR), Uses);
1397 if (Uses.size() > 1 || !Uses.count(LoLoop.End)) {
1399 LoLoop.Revert = true;
1402 LoLoop.Validate(BBUtils.get());
1403 Expand(LoLoop);
1508 void ARMLowOverheadLoops::IterationCountDCE(LowOverheadLoop &LoLoop) {
1509 if (!LoLoop.IsTailPredicationLegal())
1514 MachineInstr *Def = RDA->getMIOperand(LoLoop.Start, 1);
1521 SmallPtrSet<MachineInstr*, 4> Killed = { LoLoop.Start, LoLoop.Dec,
1522 LoLoop.End };
1523 if (!TryRemove(Def, *RDA, LoLoop.ToRemove, Killed))
1527 MachineInstr* ARMLowOverheadLoops::ExpandLoopStart(LowOverheadLoop &LoLoop) {
1531 IterationCountDCE(LoLoop);
1533 MachineBasicBlock::iterator InsertPt = LoLoop.StartInsertPt;
1534 MachineInstr *Start = LoLoop.Start;
1535 MachineBasicBlock *MBB = LoLoop.StartInsertBB;
1536 unsigned Opc = LoLoop.getStartOpcode();
1537 MachineOperand &Count = LoLoop.getLoopStartOperand();
1558 LoLoop.ToRemove.insert(Start);
1562 void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
1575 for (auto &Block : LoLoop.getVPTBlocks()) {
1592 LoLoop.BlockMasksToRecompute.insert(MIB.getInstr());
1593 LoLoop.ToRemove.insert(TheVCMP);
1597 if (LoLoop.VPTstate.isEntryPredicatedOnVCTP(Block, /*exclusive*/ true)) {
1646 LoLoop.BlockMasksToRecompute.insert(MIB.getInstr());
1655 LoLoop.ToRemove.insert(VPST);
1663 LoLoop.ToRemove.insert(VPST);
1665 LoLoop.BlockMasksToRecompute.insert(VPST);
1677 !LoLoop.ToRemove.contains(VprDef)) {
1690 LoLoop.ToRemove.insert(VPST);
1696 LoLoop.ToRemove.insert(LoLoop.VCTPs.begin(), LoLoop.VCTPs.end());
1699 void ARMLowOverheadLoops::Expand(LowOverheadLoop &LoLoop) {
1702 auto ExpandLoopEnd = [this](LowOverheadLoop &LoLoop) {
1703 MachineInstr *End = LoLoop.End;
1705 unsigned Opc = LoLoop.IsTailPredicationLegal() ?
1710 unsigned Off = LoLoop.Dec == LoLoop.End ? 1 : 0;
1714 LoLoop.ToRemove.insert(LoLoop.Dec);
1715 LoLoop.ToRemove.insert(End);
1761 if (LoLoop.Revert) {
1762 if (isWhileLoopStart(*LoLoop.Start))
1763 RevertWhile(LoLoop.Start);
1765 RevertDo(LoLoop.Start);
1766 if (LoLoop.Dec == LoLoop.End)
1767 RevertLoopEndDec(LoLoop.End);
1769 RevertLoopEnd(LoLoop.End, RevertLoopDec(LoLoop.Dec));
1771 ExpandVMOVCopies(LoLoop.VMOVCopies);
1772 LoLoop.Start = ExpandLoopStart(LoLoop);
1773 if (LoLoop.Start)
1774 RemoveDeadBranch(LoLoop.Start);
1775 LoLoop.End = ExpandLoopEnd(LoLoop);
1776 RemoveDeadBranch(LoLoop.End);
1777 if (LoLoop.IsTailPredicationLegal())
1778 ConvertVPTBlocks(LoLoop);
1779 for (auto *I : LoLoop.ToRemove) {
1783 for (auto *I : LoLoop.BlockMasksToRecompute) {
1790 PostOrderLoopTraversal DFS(LoLoop.ML, *MLI);