Lines Matching refs:LI

194                                          const LoopInfo &LI) {  in collectHomogenousInstGraphLoopInvariants()  argument
410 DominatorTree &DT, LoopInfo &LI, in hoistLoopToNewParent() argument
421 if (Loop *ExitL = LI.getLoopFor(ExitBB)) in hoistLoopToNewParent()
435 assert(OldParentL == LI.getLoopFor(&Preheader) && in hoistLoopToNewParent()
437 LI.changeLoopFor(&Preheader, NewParentL); in hoistLoopToNewParent()
446 LI.addTopLevelLoop(&L); in hoistLoopToNewParent()
465 formLCSSA(*OldContainingL, DT, &LI, SE); in hoistLoopToNewParent()
472 formDedicatedExitBlocks(OldContainingL, &DT, &LI, MSSAU, in hoistLoopToNewParent()
481 const LoopInfo &LI) { in getTopMostExitingLoop() argument
482 Loop *TopMost = LI.getLoopFor(ExitBB); in getTopMostExitingLoop()
510 LoopInfo &LI, ScalarEvolution *SE, in unswitchTrivialBranch() argument
528 Invariants = collectHomogenousInstGraphLoopInvariants(L, *CondInst, LI); in unswitchTrivialBranch()
584 if (const Loop *ExitL = getTopMostExitingLoop(LoopExitBB, LI)) in unswitchTrivialBranch()
599 BasicBlock *NewPH = SplitEdge(OldPH, L.getHeader(), &DT, &LI, MSSAU); in unswitchTrivialBranch()
612 SplitBlock(LoopExitBB, LoopExitBB->begin(), &DT, &LI, MSSAU, "", false); in unswitchTrivialBranch()
706 hoistLoopToNewParent(L, *NewPH, DT, LI, MSSAU, SE); in unswitchTrivialBranch()
744 LoopInfo &LI, ScalarEvolution *SE, in unswitchTrivialSwitch() argument
800 Loop *ExitL = getTopMostExitingLoop(DefaultExitBB, LI); in unswitchTrivialSwitch()
807 Loop *ExitL = getTopMostExitingLoop(CaseI->getCaseSuccessor(), LI); in unswitchTrivialSwitch()
864 BasicBlock *NewPH = SplitEdge(OldPH, L.getHeader(), &DT, &LI, MSSAU); in unswitchTrivialSwitch()
891 SplitBlock(DefaultExitBB, DefaultExitBB->begin(), &DT, &LI, MSSAU); in unswitchTrivialSwitch()
918 SplitExitBB = SplitBlock(ExitBB, ExitBB->begin(), &DT, &LI, MSSAU); in unswitchTrivialSwitch()
1025 hoistLoopToNewParent(L, *NewPH, DT, LI, MSSAU, SE); in unswitchTrivialSwitch()
1049 LoopInfo &LI, ScalarEvolution *SE, in unswitchAllTrivialConditions() argument
1088 if (!unswitchTrivialSwitch(L, *SI, DT, LI, SE, MSSAU)) in unswitchAllTrivialConditions()
1121 if (!unswitchTrivialBranch(L, *BI, DT, LI, SE, MSSAU)) in unswitchAllTrivialConditions()
1174 DominatorTree &DT, LoopInfo &LI, MemorySSAUpdater *MSSAU, in buildClonedLoopBlocks() argument
1220 auto *MergeBB = SplitBlock(ExitBB, ExitBB->begin(), &DT, &LI, MSSAU); in buildClonedLoopBlocks()
1365 const ValueToValueMapTy &VMap, LoopInfo &LI) { in cloneLoopNest() argument
1372 if (LI.getLoopFor(BB) == &OrigL) in cloneLoopNest()
1373 LI.changeLoopFor(ClonedBB, &ClonedL); in cloneLoopNest()
1379 Loop *ClonedRootL = LI.AllocateLoop(); in cloneLoopNest()
1383 LI.addTopLevelLoop(ClonedRootL); in cloneLoopNest()
1400 Loop *ClonedL = LI.AllocateLoop(); in cloneLoopNest()
1424 const ValueToValueMapTy &VMap, LoopInfo &LI, in buildClonedLoops() argument
1444 if (Loop *ExitL = LI.getLoopFor(ExitBB)) { in buildClonedLoops()
1511 ClonedL = LI.AllocateLoop(); in buildClonedLoops()
1513 ParentL->addBasicBlockToLoop(ClonedPH, LI); in buildClonedLoops()
1516 LI.addTopLevelLoop(ClonedL); in buildClonedLoops()
1532 if (LI.getLoopFor(BB) == &OrigL) { in buildClonedLoops()
1533 ClonedL->addBasicBlockToLoop(ClonedBB, LI); in buildClonedLoops()
1564 cloneLoopNest(*ChildL, ClonedL, VMap, LI); in buildClonedLoops()
1641 OuterL->addBasicBlockToLoop(BB, LI); in buildClonedLoops()
1647 assert(LI.getLoopFor(BB) == OuterL && in buildClonedLoops()
1668 *ChildL, ExitLoopMap.lookup(ClonedChildHeader), VMap, LI)); in buildClonedLoops()
1704 DominatorTree &DT, LoopInfo &LI, in deleteDeadBlocksFromLoop() argument
1760 LI.destroy(ChildL); in deleteDeadBlocksFromLoop()
1770 LI.changeLoopFor(BB, nullptr); in deleteDeadBlocksFromLoop()
1797 LoopInfo &LI) { in recomputeLoopBlockSet() argument
1843 if (Loop *InnerL = LI.getLoopFor(BB)) in recomputeLoopBlockSet()
1908 LoopInfo &LI, in rebuildLoopAfterUnswitch() argument
1920 if (Loop *ExitL = LI.getLoopFor(ExitBB)) { in rebuildLoopAfterUnswitch()
1929 auto LoopBlockSet = recomputeLoopBlockSet(L, LI); in rebuildLoopAfterUnswitch()
1947 LI.changeLoopFor(PH, ParentL); in rebuildLoopAfterUnswitch()
1952 LI.addTopLevelLoop(&L); in rebuildLoopAfterUnswitch()
1977 return LI.getLoopDepth(LHS) < LI.getLoopDepth(RHS); in rebuildLoopAfterUnswitch()
2000 Loop &ExitL = *LI.getLoopFor(ExitBB); in rebuildLoopAfterUnswitch()
2024 ExitL.contains(LI.getLoopFor(PredBB))) && in rebuildLoopAfterUnswitch()
2045 if (Loop *BBL = LI.getLoopFor(BB)) in rebuildLoopAfterUnswitch()
2047 LI.changeLoopFor(BB, &ExitL); in rebuildLoopAfterUnswitch()
2059 if (Loop *BBL = LI.getLoopFor(BB)) in rebuildLoopAfterUnswitch()
2061 LI.changeLoopFor(BB, nullptr); in rebuildLoopAfterUnswitch()
2086 if (auto *NewParentL = LI.getLoopFor(HoistedL->getLoopPreheader())) in rebuildLoopAfterUnswitch()
2089 LI.addTopLevelLoop(HoistedL); in rebuildLoopAfterUnswitch()
2100 LI.removeLoop(llvm::find(LI, &L)); in rebuildLoopAfterUnswitch()
2105 LI.destroy(&L); in rebuildLoopAfterUnswitch()
2178 IVConditionInfo &PartialIVInfo, DominatorTree &DT, LoopInfo &LI, in unswitchNontrivialInvariants() argument
2249 assert(LI.getLoopFor(ParentBB) == &L && "Branch in an inner loop!"); in unswitchNontrivialInvariants()
2256 LBRPO.perform(&LI); in unswitchNontrivialInvariants()
2267 Loop *NewOuterExitL = getTopMostExitingLoop(ExitBB, LI); in unswitchNontrivialInvariants()
2311 BasicBlock *LoopPH = SplitEdge(SplitBB, L.getHeader(), &DT, &LI, MSSAU); in unswitchNontrivialInvariants()
2324 DominatingSucc, *VMaps.back(), DTUpdates, AC, DT, LI, MSSAU, SE); in unswitchNontrivialInvariants()
2502 buildClonedLoops(L, ExitBlocks, *VMap, LI, NonChildClonedLoops); in unswitchNontrivialInvariants()
2507 deleteDeadBlocksFromLoop(L, ExitBlocks, DT, LI, MSSAU, SE, LoopUpdater); in unswitchNontrivialInvariants()
2514 rebuildLoopAfterUnswitch(L, ExitBlocks, LI, HoistedLoops, SE); in unswitchNontrivialInvariants()
2590 assert(ChildL->isRecursivelyLCSSAForm(DT, LI) && in unswitchNontrivialInvariants()
2597 formLCSSA(UpdateL, DT, &LI, SE); in unswitchNontrivialInvariants()
2603 formDedicatedExitBlocks(&UpdateL, &DT, &LI, MSSAU, /*PreserveLCSSA*/ true); in unswitchNontrivialInvariants()
2633 LI.verify(DT); in unswitchNontrivialInvariants()
2713 LoopInfo &LI, MemorySSAUpdater *MSSAU, in turnSelectIntoBranch() argument
2720 SI->getMetadata(LLVMContext::MD_prof), &DTU, &LI); in turnSelectIntoBranch()
2764 DominatorTree &DT, LoopInfo &LI, in turnGuardIntoBranch() argument
2776 GI->getMetadata(LLVMContext::MD_prof), &DTU, &LI); in turnGuardIntoBranch()
2801 LI.verify(DT); in turnGuardIntoBranch()
2820 const Instruction &TI, const Loop &L, const LoopInfo &LI, in CalculateUnswitchCostMultiplier() argument
2842 : std::distance(LI.begin(), LI.end())); in CalculateUnswitchCostMultiplier()
2901 const Loop &L, const LoopInfo &LI, AAResults &AA, in collectUnswitchCandidates() argument
2916 L, *static_cast<Instruction *>(Cond), LI); in collectUnswitchCandidates()
2932 if (LI.getLoopFor(BB) != &L) in collectUnswitchCandidates()
3083 DominatorTree &DT, LoopInfo &LI, in injectPendingInvariantConditions() argument
3088 assert(LI.getLoopFor(Candidate.TI->getParent()) == &L && in injectPendingInvariantConditions()
3150 L.addBasicBlockToLoop(CheckBlock, LI); in injectPendingInvariantConditions()
3154 LI.verify(DT); in injectPendingInvariantConditions()
3221 const DominatorTree &DT, const LoopInfo &LI, AAResults &AA, in collectUnswitchCandidatesWithInjections() argument
3244 if (LI.getLoopFor(BB) != &L) in collectUnswitchCandidatesWithInjections()
3273 static bool isSafeForNoNTrivialUnswitching(Loop &L, LoopInfo &LI) { in isSafeForNoNTrivialUnswitching() argument
3294 RPOT.perform(&LI); in isSafeForNoNTrivialUnswitching()
3295 if (containsIrreducibleCFG<const BasicBlock *>(RPOT, LI)) in isSafeForNoNTrivialUnswitching()
3318 const DominatorTree &DT, const LoopInfo &LI, AssumptionCache &AC, in findBestNonTrivialUnswitchCandidate() argument
3445 CalculateUnswitchCostMultiplier(TI, L, LI, DT, UnswitchCandidates); in findBestNonTrivialUnswitchCandidate()
3493 static bool unswitchBestCondition(Loop &L, DominatorTree &DT, LoopInfo &LI, in unswitchBestCondition() argument
3504 PartialIVCondBranch, L, LI, AA, MSSAU); in unswitchBestCondition()
3507 PartialIVCondBranch, L, DT, LI, AA, in unswitchBestCondition()
3518 UnswitchCandidates, L, DT, LI, AC, TTI, PartialIVInfo); in unswitchBestCondition()
3531 Best = injectPendingInvariantConditions(Best, L, DT, LI, AC, MSSAU); in unswitchBestCondition()
3548 Best.TI = turnSelectIntoBranch(SI, DT, LI, MSSAU, &AC); in unswitchBestCondition()
3553 turnGuardIntoBranch(cast<IntrinsicInst>(Best.TI), L, DT, LI, MSSAU); in unswitchBestCondition()
3560 LI, AC, SE, MSSAU, LoopUpdater, InsertFreeze, in unswitchBestCondition()
3586 static bool unswitchLoop(Loop &L, DominatorTree &DT, LoopInfo &LI, in unswitchLoop() argument
3592 assert(L.isRecursivelyLCSSAForm(DT, LI) && in unswitchLoop()
3600 if (Trivial && unswitchAllTrivialConditions(L, DT, LI, SE, MSSAU)) { in unswitchLoop()
3663 if (!isSafeForNoNTrivialUnswitching(L, LI)) in unswitchLoop()
3674 if (unswitchBestCondition(L, DT, LI, AC, AA, TTI, SE, MSSAU, LoopUpdater)) in unswitchLoop()
3700 if (!unswitchLoop(L, AR.DT, AR.LI, AR.AC, AR.AA, AR.TTI, Trivial, NonTrivial, in run()