Lines Matching defs:Restore
12 // (resp. Restore).
15 // between 2) two executions of the Save (resp. Restore) point there is an
16 // execution of the Restore (resp. Save) point.
22 // Restore
24 // Indeed, the execution looks like Save -> Restore -> Save -> Restore ...
32 // Restore
34 // Indeed, the execution looks like Save -> Save -> ... -> Restore -> Restore.
127 MachineBasicBlock *Restore = nullptr;
133 /// Hold the loop information. Used to determine if Save and Restore
172 /// after Save and before Restore.
191 /// Update the Save and Restore points such that \p MBB is in
192 /// the region that is dominated by Save and post-dominated by Restore
193 /// and Save and Restore still match the safe point definition.
194 /// Such point may not exist and Save and/or Restore may be null after
230 Restore = nullptr;
247 /// Check whether or not Save and Restore points are still interesting for
249 bool ArePointsInteresting() const { return Save != Entry && Save && Restore; }
431 /// Restore.
450 /// Restore point has been split.
520 /// Restore point was split and the change needs to be unrolled. Make necessary
581 InitRestore = Restore;
663 Restore = NewRestore;
668 assert((MDT->dominates(Save, Restore) && MPDT->dominates(Restore, Save)) &&
670 assert((!MLI->getLoopFor(Save) && !MLI->getLoopFor(Restore)) &&
673 EntryFreq >= MBFI->getBlockFreq(Restore)) &&
687 if (!Restore)
688 Restore = &MBB;
693 // return `Restore`.
694 Restore = MPDT->findNearestCommonDominator(Restore, &MBB);
696 Restore = nullptr; // Abort, we can't find a restore point in this case.
700 if (Restore == &MBB) {
706 Restore = nullptr; // Abort, we can't find a restore point in this case.
711 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
716 if (!Restore) {
718 dbgs() << "Restore point needs to be spanned on several blocks\n");
722 // Make sure Save and Restore are suitable for shrink-wrapping:
723 // 1. all path from Save needs to lead to Restore before exiting.
724 // 2. all path to Restore needs to go through Save from Entry.
726 // A. Save dominates Restore.
727 // B. Restore post-dominates Save.
728 // C. Save and Restore are in the same loop.
731 while (Restore &&
732 (!(SaveDominatesRestore = MDT->dominates(Save, Restore)) ||
733 !(RestorePostDominatesSave = MPDT->dominates(Restore, Save)) ||
739 // Restore
745 // by Restore. However, the CSRs uses are still reachable after
746 // Restore and before Save are executed.
751 MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
754 Save = MDT->findNearestCommonDominator(Save, Restore);
759 Restore = MPDT->findNearestCommonDominator(Restore, Save);
762 if (Restore && (MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
763 if (MLI->getLoopDepth(Save) > MLI->getLoopDepth(Restore)) {
773 MLI->getLoopFor(Restore)->getExitingBlocks(ExitBlocks);
774 // Push Restore outside of this loop.
776 MachineBasicBlock *IPdom = Restore;
785 if (IPdom && MLI->getLoopDepth(IPdom) < MLI->getLoopDepth(Restore))
786 Restore = IPdom;
788 Restore = nullptr;
870 assert(!Save && !Restore && "We miss a shrink-wrap opportunity?!");
884 << "\nRestore: " << printMBBReference(*Restore) << ' '
885 << printBlockFreq(*MBFI, *Restore) << '\n');
889 EntryFreq >= MBFI->getBlockFreq(Restore)) &&
891 TFI->canUseAsEpilogue(*Restore)))
902 // Restore is expensive.
903 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
904 if (!Restore)
906 NewBB = Restore;
909 } while (Save && Restore);
959 << "\nRestore: " << printMBBReference(*Restore) << '\n');
963 MFI.setRestorePoint(Restore);