Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:Restore

13 // (resp. Restore).
16 // between 2) two executions of the Save (resp. Restore) point there is an
17 // execution of the Restore (resp. Save) point.
23 // Restore
25 // Indeed, the execution looks like Save -> Restore -> Save -> Restore ...
33 // Restore
35 // Indeed, the execution looks like Save -> Save -> ... -> Restore -> Restore.
61 // For property #1 for Restore.
110 MachineBasicBlock *Restore;
114 /// Hold the loop information. Used to determine if Save and Restore
133 /// after Save and before Restore.
151 /// \brief Update the Save and Restore points such that \p MBB is in
152 /// the region that is dominated by Save and post-dominated by Restore
153 /// and Save and Restore still match the safe point definition.
154 /// Such point may not exist and Save and/or Restore may be null after
164 Restore = nullptr;
178 /// Check whether or not Save and Restore points are still interesting for
180 bool ArePointsInteresting() const { return Save != Entry && Save && Restore; }
282 if (!Restore)
283 Restore = &MBB;
285 Restore = MPDT->findNearestCommonDominator(Restore, &MBB);
287 // Make sure we would be able to insert the restore code before the
289 if (Restore == &MBB) {
293 // One of the terminator needs to happen before the restore point.
295 Restore = nullptr;
298 // Look for a restore point that post-dominates all the successors.
300 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
305 if (!Restore) {
306 DEBUG(dbgs() << "Restore point needs to be spanned on several blocks\n");
310 // Make sure Save and Restore are suitable for shrink-wrapping:
311 // 1. all path from Save needs to lead to Restore before exiting.
312 // 2. all path to Restore needs to go through Save from Entry.
314 // A. Save dominates Restore.
315 // B. Restore post-dominates Save.
316 // C. Save and Restore are in the same loop.
319 while (Save && Restore &&
320 (!(SaveDominatesRestore = MDT->dominates(Save, Restore)) ||
321 !(RestorePostDominatesSave = MPDT->dominates(Restore, Save)) ||
327 // Restore
333 // by Restore. However, the CSRs uses are still reachable after
334 // Restore and before Save are executed.
336 // For now, just push the restore/save points outside of loops.
339 MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
342 Save = MDT->findNearestCommonDominator(Save, Restore);
347 Restore = MPDT->findNearestCommonDominator(Restore, Save);
350 if (Save && Restore &&
351 (MLI->getLoopFor(Save) || MLI->getLoopFor(Restore))) {
352 if (MLI->getLoopDepth(Save) > MLI->getLoopDepth(Restore)) {
366 MLI->getLoopFor(Restore)->getExitingBlocks(ExitBlocks);
367 // Push Restore outside of this loop.
369 MachineBasicBlock *IPdom = Restore;
378 if (IPdom && MLI->getLoopDepth(IPdom) < MLI->getLoopDepth(Restore))
379 Restore = IPdom;
381 Restore = nullptr;
413 // Save (resp. restore) point must dominate (resp. post dominate)
417 // save/restore instructions, just give up.
431 assert(!Save && !Restore && "We miss a shrink-wrap opportunity?!");
444 << Restore->getNumber() << ' ' << Restore->getName() << ' '
445 << MBFI->getBlockFreq(Restore).getFrequency() << '\n');
449 EntryFreq >= MBFI->getBlockFreq(Restore).getFrequency()) &&
451 TFI->canUseAsEpilogue(*Restore)))
461 // Restore is expensive.
462 Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT);
463 if (!Restore)
465 NewBB = Restore;
468 } while (Save && Restore);
477 << Restore->getNumber() << ' ' << Restore->getName() << '\n');
481 MFI->setRestorePoint(Restore);