Lines Matching refs:CurLoop

161 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI);
162 static bool isNotUsedOrFoldableInLoop(const Instruction &I, const Loop *CurLoop,
166 static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
171 const Loop *CurLoop, ICFLoopSafetyInfo *SafetyInfo,
175 const Loop *CurLoop, const LoopSafetyInfo *SafetyInfo,
179 Loop *CurLoop, Instruction &I,
546 TargetTransformInfo *TTI, Loop *CurLoop, in sinkRegion() argument
553 CurLoop != nullptr && SafetyInfo != nullptr && in sinkRegion()
559 SmallVector<DomTreeNode *, 16> Worklist = collectChildrenInLoop(N, CurLoop); in sinkRegion()
566 if (inSubLoop(BB, CurLoop, LI)) in sinkRegion()
592 isNotUsedOrFoldableInLoop(I, LoopNestMode ? OutermostLoop : CurLoop, in sinkRegion()
595 canSinkOrHoistInst(I, AA, DT, CurLoop, MSSAU, true, Flags, ORE)) { in sinkRegion()
596 if (sink(I, LI, DT, CurLoop, SafetyInfo, MSSAU, ORE)) { in sinkRegion()
614 TargetTransformInfo *TTI, Loop *CurLoop, in sinkRegionForLoopNest() argument
622 Worklist.insert(CurLoop); in sinkRegionForLoopNest()
623 appendLoopsToWorklist(*CurLoop, Worklist); in sinkRegionForLoopNest()
627 MSSAU, SafetyInfo, Flags, ORE, CurLoop); in sinkRegionForLoopNest()
645 Loop *CurLoop; member in __anon7e16e74e0511::ControlFlowHoister
657 ControlFlowHoister(LoopInfo *LI, DominatorTree *DT, Loop *CurLoop, in ControlFlowHoister() argument
659 : LI(LI), DT(DT), CurLoop(CurLoop), MSSAU(MSSAU) {} in ControlFlowHoister()
664 !CurLoop->hasLoopInvariantOperands(BI)) in registerPossiblyHoistableBranch()
672 if (!CurLoop->contains(TrueDest) || !CurLoop->contains(FalseDest) || in registerPossiblyHoistableBranch()
719 if (!ControlFlowHoisting || !CurLoop->hasLoopInvariantOperands(PN)) in canHoistPHI()
757 return CurLoop->getLoopPreheader(); in getOrCreateHoistedBlock()
771 BasicBlock *InitialPreheader = CurLoop->getLoopPreheader(); in getOrCreateHoistedBlock()
799 if (CurLoop->getParentLoop()) in getOrCreateHoistedBlock()
800 CurLoop->getParentLoop()->addBasicBlockToLoop(New, *LI); in getOrCreateHoistedBlock()
838 DomTreeNode *HeaderNode = DT->getNode(CurLoop->getHeader()); in getOrCreateHoistedBlock()
853 assert(CurLoop->getLoopPreheader() && in getOrCreateHoistedBlock()
867 TargetLibraryInfo *TLI, Loop *CurLoop, in hoistRegion() argument
875 CurLoop != nullptr && SafetyInfo != nullptr && in hoistRegion()
878 ControlFlowHoister CFH(LI, DT, CurLoop, MSSAU); in hoistRegion()
887 LoopBlocksRPO Worklist(CurLoop); in hoistRegion()
890 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in hoistRegion()
894 if (!LoopNestMode && inSubLoop(BB, CurLoop, LI)) in hoistRegion()
905 if (CurLoop->hasLoopInvariantOperands(&I) && in hoistRegion()
906 canSinkOrHoistInst(I, AA, DT, CurLoop, MSSAU, true, Flags, ORE) && in hoistRegion()
908 I, DT, TLI, CurLoop, SafetyInfo, ORE, in hoistRegion()
910 hoist(I, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
920 CurLoop->isLoopInvariant(I.getOperand(1))) { in hoistRegion()
936 hoist(*ReciprocalDivisor, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), in hoistRegion()
949 return SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop) && in hoistRegion()
950 SafetyInfo->doesNotWriteMemoryBefore(I, CurLoop); in hoistRegion()
953 CurLoop->hasLoopInvariantOperands(&I) && in hoistRegion()
955 hoist(I, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
969 hoist(*PN, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
979 if (hoistArithmetics(I, *CurLoop, *SafetyInfo, MSSAU, AC, DT)) { in hoistRegion()
1042 Loop *CurLoop) { in isLoadInvariantInLoop() argument
1088 DT->properlyDominates(II->getParent(), CurLoop->getHeader())) in isLoadInvariantInLoop()
1150 Loop *CurLoop, MemorySSAUpdater &MSSAU, in canSinkOrHoistInst() argument
1175 if (isLoadInvariantInLoop(LI, DT, CurLoop)) in canSinkOrHoistInst()
1183 MSSA, MU, CurLoop, I, Flags, InvariantGroup); in canSinkOrHoistInst()
1186 if (ORE && Invalidated && CurLoop->isLoopInvariant(LI->getPointerOperand())) in canSinkOrHoistInst()
1238 MSSA, cast<MemoryUse>(MSSA->getMemoryAccess(CI)), CurLoop, I, in canSinkOrHoistInst()
1246 if (isReadOnly(MSSAU, CurLoop)) in canSinkOrHoistInst()
1257 return isOnlyMemoryAccess(FI, CurLoop, MSSAU); in canSinkOrHoistInst()
1267 if (isOnlyMemoryAccess(SI, CurLoop, MSSAU)) in canSinkOrHoistInst()
1279 CurLoop->contains(Source->getBlock())) in canSinkOrHoistInst()
1287 for (auto *BB : CurLoop->getBlocks()) in canSinkOrHoistInst()
1294 CurLoop->contains(MD->getBlock())) in canSinkOrHoistInst()
1343 static bool isFoldableInLoop(const Instruction &I, const Loop *CurLoop, in isFoldableInLoop() argument
1356 if (CurLoop->contains(UI) && in isFoldableInLoop()
1373 static bool isNotUsedOrFoldableInLoop(const Instruction &I, const Loop *CurLoop, in isNotUsedOrFoldableInLoop() argument
1378 bool IsFoldable = isFoldableInLoop(I, CurLoop, TTI); in isNotUsedOrFoldableInLoop()
1397 if (!CurLoop->contains(UI)) in isNotUsedOrFoldableInLoop()
1404 if (CurLoop->contains(UI)) { in isNotUsedOrFoldableInLoop()
1513 const LoopSafetyInfo *SafetyInfo, const Loop *CurLoop, in sinkThroughTriviallyReplaceablePHI() argument
1546 LoopInfo *LI, const Loop *CurLoop, in splitPredecessorsOfLoopExit() argument
1551 CurLoop->getUniqueExitBlocks(ExitBlocks); in splitPredecessorsOfLoopExit()
1594 assert(CurLoop->contains(PredBB) && in splitPredecessorsOfLoopExit()
1618 const Loop *CurLoop, ICFLoopSafetyInfo *SafetyInfo, in sink() argument
1631 if (VisitedUsers.count(User) || CurLoop->contains(User)) in sink()
1662 splitPredecessorsOfLoopExit(PN, DT, LI, CurLoop, SafetyInfo, &MSSAU); in sink()
1685 CurLoop->getUniqueExitBlocks(ExitBlocks); in sink()
1702 if (CurLoop->contains(User)) in sink()
1711 PN, &I, LI, SunkCopies, SafetyInfo, CurLoop, MSSAU); in sink()
1724 static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop, in hoist() argument
1747 !SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop)) in hoist()
1772 const Loop *CurLoop, const LoopSafetyInfo *SafetyInfo, in isSafeToExecuteUnconditionally() argument
1780 SafetyInfo->isGuaranteedToExecute(Inst, DT, CurLoop); in isSafeToExecuteUnconditionally()
1784 if (LI && CurLoop->isLoopInvariant(LI->getPointerOperand())) in isSafeToExecuteUnconditionally()
1958 const TargetLibraryInfo *TLI, TargetTransformInfo *TTI, Loop *CurLoop, in promoteLoopAccessesToScalars() argument
1963 assert(LI != nullptr && DT != nullptr && CurLoop != nullptr && in promoteLoopAccessesToScalars()
1975 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in promoteLoopAccessesToScalars()
2048 if (!isNotVisibleOnUnwindInLoop(Object, CurLoop, DT)) in promoteLoopAccessesToScalars()
2060 if (!UI || !CurLoop->contains(UI)) in promoteLoopAccessesToScalars()
2081 *Load, DT, TLI, CurLoop, SafetyInfo, ORE, in promoteLoopAccessesToScalars()
2104 SafetyInfo->isGuaranteedToExecute(*UI, DT, CurLoop); in promoteLoopAccessesToScalars()
2181 isThreadLocalObject(Object, CurLoop, DT, TTI)) in promoteLoopAccessesToScalars()
2335 Loop *CurLoop, Instruction &I, in pointerInvalidatedByLoop() argument
2352 CurLoop->contains(Source->getBlock()) && in pointerInvalidatedByLoop()
2353 … !(InvariantGroup && Source->getBlock() == CurLoop->getHeader() && isa<MemoryPhi>(Source)); in pointerInvalidatedByLoop()
2375 for (auto *BB : CurLoop->getBlocks()) in pointerInvalidatedByLoop()
2379 if (!CurLoop->contains(&I)) in pointerInvalidatedByLoop()
2769 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI) { in inSubLoop() argument
2770 assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop"); in inSubLoop()
2771 return LI->getLoopFor(BB) != CurLoop; in inSubLoop()