Lines Matching refs:CurLoop
74 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI);
75 static bool isNotUsedInLoop(Instruction &I, Loop *CurLoop);
78 Loop *CurLoop, AliasSetTracker *CurAST );
80 Loop *CurLoop, LICMSafetyInfo *SafetyInfo);
82 Loop *CurLoop,
91 DominatorTree *DT, Loop *CurLoop,
138 Loop *CurLoop; // The current loop we are working on... member
204 CurLoop = L; in runOnLoop()
222 computeLICMSafetyInfo(&SafetyInfo, CurLoop); in runOnLoop()
235 Changed |= sinkRegion(DT->getNode(L->getHeader()), AA, LI, DT, TLI, CurLoop, in runOnLoop()
239 CurLoop, CurAST, &SafetyInfo); in runOnLoop()
252 PIC, LI, DT, CurLoop, in runOnLoop()
274 CurLoop = nullptr; in runOnLoop()
292 DominatorTree *DT, TargetLibraryInfo *TLI, Loop *CurLoop, in sinkRegion() argument
297 DT != nullptr && CurLoop != nullptr && CurAST != nullptr && in sinkRegion()
305 if (!CurLoop->contains(BB)) return Changed; in sinkRegion()
311 sinkRegion(Children[i], AA, LI, DT, TLI, CurLoop, CurAST, SafetyInfo); in sinkRegion()
314 if (inSubLoop(BB,CurLoop,LI)) return Changed; in sinkRegion()
335 if (isNotUsedInLoop(I, CurLoop) && in sinkRegion()
336 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, SafetyInfo)) { in sinkRegion()
338 Changed |= sink(I, LI, DT, CurLoop, CurAST); in sinkRegion()
350 DominatorTree *DT, TargetLibraryInfo *TLI, Loop *CurLoop, in hoistRegion() argument
354 DT != nullptr && CurLoop != nullptr && CurAST != nullptr && in hoistRegion()
361 if (!CurLoop->contains(BB)) return Changed; in hoistRegion()
364 if (!inSubLoop(BB, CurLoop, LI)) in hoistRegion()
384 if (CurLoop->hasLoopInvariantOperands(&I) && in hoistRegion()
385 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, SafetyInfo) && in hoistRegion()
386 isSafeToExecuteUnconditionally(I, DT, CurLoop, SafetyInfo)) in hoistRegion()
387 Changed |= hoist(I, CurLoop->getLoopPreheader()); in hoistRegion()
393 hoistRegion(Children[i], AA, LI, DT, TLI, CurLoop, CurAST, SafetyInfo); in hoistRegion()
400 void llvm::computeLICMSafetyInfo(LICMSafetyInfo * SafetyInfo, Loop * CurLoop) { in computeLICMSafetyInfo() argument
401 assert(CurLoop != nullptr && "CurLoop cant be null"); in computeLICMSafetyInfo()
402 BasicBlock *Header = CurLoop->getHeader(); in computeLICMSafetyInfo()
413 for (Loop::block_iterator BB = CurLoop->block_begin(), in computeLICMSafetyInfo()
414 BBE = CurLoop->block_end(); (BB != BBE) && !SafetyInfo->MayThrow ; ++BB) in computeLICMSafetyInfo()
424 Loop *CurLoop, AliasSetTracker *CurAST, in canSinkOrHoistInst() argument
485 return isSafeToExecuteUnconditionally(I, DT, CurLoop, SafetyInfo); in canSinkOrHoistInst()
505 static bool isNotUsedInLoop(Instruction &I, Loop *CurLoop) { in isNotUsedInLoop() argument
514 if (CurLoop->contains(PN)) in isNotUsedInLoop()
524 if (CurLoop->contains(PN->getIncomingBlock(i))) in isNotUsedInLoop()
530 if (CurLoop->contains(UI)) in isNotUsedInLoop()
571 Loop *CurLoop, AliasSetTracker *CurAST ) { in sink() argument
581 CurLoop->getUniqueExitBlocks(ExitBlocks); in sink()
641 Loop *CurLoop, in isSafeToExecuteUnconditionally() argument
647 return isGuaranteedToExecute(Inst, DT, CurLoop, SafetyInfo); in isSafeToExecuteUnconditionally()
651 Loop *CurLoop, LICMSafetyInfo * SafetyInfo) { in isGuaranteedToExecute() argument
660 if (Inst.getParent() == CurLoop->getHeader()) in isGuaranteedToExecute()
672 CurLoop->getExitBlocks(ExitBlocks); in isGuaranteedToExecute()
774 DominatorTree *DT, Loop *CurLoop, in promoteLoopAccessesToScalars() argument
779 CurLoop != nullptr && CurAST != nullptr && in promoteLoopAccessesToScalars()
788 AS.isVolatile() || !CurLoop->isLoopInvariant(AS.begin()->getValue())) in promoteLoopAccessesToScalars()
795 BasicBlock * Preheader = CurLoop->getLoopPreheader(); in promoteLoopAccessesToScalars()
819 bool HasDedicatedExits = CurLoop->hasDedicatedExits(); in promoteLoopAccessesToScalars()
837 if (!UI || !CurLoop->contains(UI)) in promoteLoopAccessesToScalars()
872 if (isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo)) { in promoteLoopAccessesToScalars()
879 CurLoop, SafetyInfo); in promoteLoopAccessesToScalars()
914 CurLoop->getUniqueExitBlocks(ExitBlocks); in promoteLoopAccessesToScalars()
992 static bool inSubLoop(BasicBlock *BB, Loop *CurLoop, LoopInfo *LI) { in inSubLoop() argument
993 assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop"); in inSubLoop()
994 return LI->getLoopFor(BB) != CurLoop; in inSubLoop()