Lines Matching refs:CurLoop

151 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI);
152 static bool isNotUsedOrFreeInLoop(const Instruction &I, const Loop *CurLoop,
155 static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
160 BlockFrequencyInfo *BFI, const Loop *CurLoop,
166 const Loop *CurLoop,
171 AliasSetTracker *CurAST, Loop *CurLoop,
174 Loop *CurLoop, Instruction &I,
555 Loop *CurLoop, AliasSetTracker *CurAST, in sinkRegion() argument
562 CurLoop != nullptr && SafetyInfo != nullptr && in sinkRegion()
570 SmallVector<DomTreeNode *, 16> Worklist = collectChildrenInLoop(N, CurLoop); in sinkRegion()
577 if (inSubLoop(BB, CurLoop, LI)) in sinkRegion()
602 isNotUsedOrFreeInLoop(I, CurLoop, SafetyInfo, TTI, FreeInLoop) && in sinkRegion()
603 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags, in sinkRegion()
605 if (sink(I, LI, DT, BFI, CurLoop, SafetyInfo, MSSAU, ORE)) { in sinkRegion()
634 Loop *CurLoop; member in __anoncfbeaccc0511::ControlFlowHoister
646 ControlFlowHoister(LoopInfo *LI, DominatorTree *DT, Loop *CurLoop, in ControlFlowHoister() argument
648 : LI(LI), DT(DT), CurLoop(CurLoop), MSSAU(MSSAU) {} in ControlFlowHoister()
653 !CurLoop->hasLoopInvariantOperands(BI)) in registerPossiblyHoistableBranch()
661 if (!CurLoop->contains(TrueDest) || !CurLoop->contains(FalseDest) || in registerPossiblyHoistableBranch()
708 if (!ControlFlowHoisting || !CurLoop->hasLoopInvariantOperands(PN)) in canHoistPHI()
746 return CurLoop->getLoopPreheader(); in getOrCreateHoistedBlock()
760 BasicBlock *InitialPreheader = CurLoop->getLoopPreheader(); in getOrCreateHoistedBlock()
788 if (CurLoop->getParentLoop()) in getOrCreateHoistedBlock()
789 CurLoop->getParentLoop()->addBasicBlockToLoop(New, *LI); in getOrCreateHoistedBlock()
828 DomTreeNode *HeaderNode = DT->getNode(CurLoop->getHeader()); in getOrCreateHoistedBlock()
843 assert(CurLoop->getLoopPreheader() && in getOrCreateHoistedBlock()
886 TargetLibraryInfo *TLI, Loop *CurLoop, in hoistRegion() argument
893 CurLoop != nullptr && SafetyInfo != nullptr && in hoistRegion()
898 ControlFlowHoister CFH(LI, DT, CurLoop, MSSAU); in hoistRegion()
907 LoopBlocksRPO Worklist(CurLoop); in hoistRegion()
913 if (!LoopNestMode && inSubLoop(BB, CurLoop, LI)) in hoistRegion()
942 if (CurLoop->hasLoopInvariantOperands(&I) && in hoistRegion()
943 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags, in hoistRegion()
945 worthSinkOrHoistInst(I, CurLoop->getLoopPreheader(), ORE, BFI) && in hoistRegion()
947 I, DT, TLI, CurLoop, SafetyInfo, ORE, in hoistRegion()
948 CurLoop->getLoopPreheader()->getTerminator())) { in hoistRegion()
949 hoist(I, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
959 CurLoop->isLoopInvariant(I.getOperand(1))) { in hoistRegion()
975 hoist(*ReciprocalDivisor, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), in hoistRegion()
988 return SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop) && in hoistRegion()
989 SafetyInfo->doesNotWriteMemoryBefore(I, CurLoop); in hoistRegion()
992 CurLoop->hasLoopInvariantOperands(&I) && in hoistRegion()
994 hoist(I, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
1008 hoist(*PN, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, in hoistRegion()
1073 Loop *CurLoop) { in isLoadInvariantInLoop() argument
1129 DT->properlyDominates(II->getParent(), CurLoop->getHeader())) in isLoadInvariantInLoop()
1188 Loop *CurLoop, AliasSetTracker *CurAST, in canSinkOrHoistInst() argument
1220 if (isLoadInvariantInLoop(LI, DT, CurLoop)) in canSinkOrHoistInst()
1226 CurLoop, AA); in canSinkOrHoistInst()
1229 MSSA, cast<MemoryUse>(MSSA->getMemoryAccess(LI)), CurLoop, I, *Flags); in canSinkOrHoistInst()
1232 if (ORE && Invalidated && CurLoop->isLoopInvariant(LI->getPointerOperand())) in canSinkOrHoistInst()
1281 MemoryLocation::getBeforeOrAfter(Op), CurAST, CurLoop, AA); in canSinkOrHoistInst()
1284 MSSA, cast<MemoryUse>(MSSA->getMemoryAccess(CI)), CurLoop, I, in canSinkOrHoistInst()
1294 if (isReadOnly(CurAST, MSSAU, CurLoop)) in canSinkOrHoistInst()
1319 return isOnlyMemoryAccess(FI, CurLoop, MSSAU); in canSinkOrHoistInst()
1342 if (isOnlyMemoryAccess(SI, CurLoop, MSSAU)) in canSinkOrHoistInst()
1354 for (auto *BB : CurLoop->getBlocks()) in canSinkOrHoistInst()
1360 CurLoop->contains(MD->getBlock())) in canSinkOrHoistInst()
1389 !CurLoop->contains(Source->getBlock()); in canSinkOrHoistInst()
1414 static bool isFreeInLoop(const Instruction &I, const Loop *CurLoop, in isFreeInLoop() argument
1427 if (CurLoop->contains(UI) && in isFreeInLoop()
1444 static bool isNotUsedOrFreeInLoop(const Instruction &I, const Loop *CurLoop, in isNotUsedOrFreeInLoop() argument
1448 bool IsFree = isFreeInLoop(I, CurLoop, TTI); in isNotUsedOrFreeInLoop()
1465 if (CurLoop->contains(UI)) { in isNotUsedOrFreeInLoop()
1577 const LoopSafetyInfo *SafetyInfo, const Loop *CurLoop, in sinkThroughTriviallyReplaceablePHI() argument
1612 LoopInfo *LI, const Loop *CurLoop, in splitPredecessorsOfLoopExit() argument
1617 CurLoop->getUniqueExitBlocks(ExitBlocks); in splitPredecessorsOfLoopExit()
1660 assert(CurLoop->contains(PredBB) && in splitPredecessorsOfLoopExit()
1684 BlockFrequencyInfo *BFI, const Loop *CurLoop, in sink() argument
1698 if (VisitedUsers.count(User) || CurLoop->contains(User)) in sink()
1729 splitPredecessorsOfLoopExit(PN, DT, LI, CurLoop, SafetyInfo, MSSAU); in sink()
1752 CurLoop->getUniqueExitBlocks(ExitBlocks); in sink()
1770 if (CurLoop->contains(User)) in sink()
1787 PN, &I, LI, SunkCopies, SafetyInfo, CurLoop, MSSAU); in sink()
1798 static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop, in hoist() argument
1821 !SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop)) in hoist()
1846 const Loop *CurLoop, in isSafeToExecuteUnconditionally() argument
1854 SafetyInfo->isGuaranteedToExecute(Inst, DT, CurLoop); in isSafeToExecuteUnconditionally()
1858 if (LI && CurLoop->isLoopInvariant(LI->getPointerOperand())) in isSafeToExecuteUnconditionally()
2026 Loop *CurLoop, AliasSetTracker *CurAST, MemorySSAUpdater *MSSAU, in promoteLoopAccessesToScalars() argument
2029 assert(LI != nullptr && DT != nullptr && CurLoop != nullptr && in promoteLoopAccessesToScalars()
2034 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in promoteLoopAccessesToScalars()
2096 if (!isKnownNonEscaping(Object, CurLoop, TLI, DT)) in promoteLoopAccessesToScalars()
2116 if (!UI || !CurLoop->contains(UI)) in promoteLoopAccessesToScalars()
2135 if (isSafeToExecuteUnconditionally(*Load, DT, TLI, CurLoop, in promoteLoopAccessesToScalars()
2161 if (SafetyInfo->isGuaranteedToExecute(*UI, DT, CurLoop)) { in promoteLoopAccessesToScalars()
2231 isNotCapturedBeforeOrInLoop(Object, CurLoop, DT); in promoteLoopAccessesToScalars()
2380 AliasSetTracker *CurAST, Loop *CurLoop, in pointerInvalidatedByLoop() argument
2403 if (CurLoop->begin() != CurLoop->end()) in pointerInvalidatedByLoop()
2407 for (BasicBlock *BB : CurLoop->getBlocks()) in pointerInvalidatedByLoop()
2427 Loop *CurLoop, Instruction &I, in pointerInvalidatedByLoopWithMSSA() argument
2440 CurLoop->contains(Source->getBlock()); in pointerInvalidatedByLoopWithMSSA()
2462 for (auto *BB : CurLoop->getBlocks()) in pointerInvalidatedByLoopWithMSSA()
2466 if (!CurLoop->contains(&I)) in pointerInvalidatedByLoopWithMSSA()
2485 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI) { in inSubLoop() argument
2486 assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop"); in inSubLoop()
2487 return LI->getLoopFor(BB) != CurLoop; in inSubLoop()