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.
128 MachineBasicBlock *Restore = nullptr;
134 /// Hold the loop information. Used to determine if Save and Restore
173 /// after Save and before Restore.
192 /// Update the Save and Restore points such that \p MBB is in
193 /// the region that is dominated by Save and post-dominated by Restore
194 /// and Save and Restore still match the safe point definition.
195 /// Such point may not exist and Save and/or Restore may be null after
231 Restore = nullptr;
248 /// Check whether or not Save and Restore points are still interesting for
250 bool ArePointsInteresting() const { return Save != Entry && Save && Restore; }
438 /// Restore.
458 /// Restore point has been split.
528 /// Restore point was split and the change needs to be unrolled. Make necessary
589 InitRestore = Restore;
671 Restore = NewRestore;
676 assert((MDT->dominates(Save, Restore) && MPDT->dominates(Restore, Save)) &&
678 assert((!MLI->getLoopFor(Save) && !MLI->getLoopFor(Restore)) &&
681 EntryFreq >= MBFI->getBlockFreq(Restore)) &&
695 if (!Restore)
696 Restore = &MBB;
701 // return `Restore`.
702 Restore = MPDT->findNearestCommonDominator(Restore, &MBB);
704 Restore = nullptr; // Abort, we can't find a restore point in this case.
708 if (Restore == &MBB) {
714 Restore = nullptr; // Abort, we can't find a restore point in this case.
719 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
724 if (!Restore) {
726 dbgs() << "Restore point needs to be spanned on several blocks\n");
730 // Make sure Save and Restore are suitable for shrink-wrapping:
731 // 1. all path from Save needs to lead to Restore before exiting.
732 // 2. all path to Restore needs to go through Save from Entry.
734 // A. Save dominates Restore.
735 // B. Restore post-dominates Save.
736 // C. Save and Restore are in the same loop.
739 while (Restore &&
740 (!(SaveDominatesRestore = MDT->dominates(Save, Restore)) ||
741 !(RestorePostDominatesSave = MPDT->dominates(Restore, Save)) ||
747 // Restore
753 // by Restore. However, the CSRs uses are still reachable after
754 // Restore and before Save are executed.
759 MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
762 Save = MDT->findNearestCommonDominator(Save, Restore);
767 Restore = MPDT->findNearestCommonDominator(Restore, Save);
770 if (Restore && (MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
771 if (MLI->getLoopDepth(Save) > MLI->getLoopDepth(Restore)) {
781 MLI->getLoopFor(Restore)->getExitingBlocks(ExitBlocks);
782 // Push Restore outside of this loop.
784 MachineBasicBlock *IPdom = Restore;
793 if (IPdom && MLI->getLoopDepth(IPdom) < MLI->getLoopDepth(Restore))
794 Restore = IPdom;
796 Restore = nullptr;
878 assert(!Save && !Restore && "We miss a shrink-wrap opportunity?!");
892 << "\nRestore: " << printMBBReference(*Restore) << ' '
893 << printBlockFreq(*MBFI, *Restore) << '\n');
897 EntryFreq >= MBFI->getBlockFreq(Restore)) &&
899 TFI->canUseAsEpilogue(*Restore)))
910 // Restore is expensive.
911 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
912 if (!Restore)
914 NewBB = Restore;
917 } while (Save && Restore);
967 << "\nRestore: " << printMBBReference(*Restore) << '\n');
971 MFI.setRestorePoint(Restore);