Lines Matching refs:CurLoop

51 void SimpleLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) {  in computeLoopSafetyInfo()  argument
52 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
53 BasicBlock *Header = CurLoop->getHeader(); in computeLoopSafetyInfo()
60 assert(Header == *CurLoop->getBlocks().begin() && in computeLoopSafetyInfo()
62 for (Loop::block_iterator BB = std::next(CurLoop->block_begin()), in computeLoopSafetyInfo()
63 BBE = CurLoop->block_end(); in computeLoopSafetyInfo()
67 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
78 void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) { in computeLoopSafetyInfo() argument
79 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
84 for (const auto &BB : CurLoop->blocks()) in computeLoopSafetyInfo()
89 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
103 void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) { in computeBlockColors() argument
106 Function *Fn = CurLoop->getHeader()->getParent(); in computeBlockColors()
118 const Loop *CurLoop) { in CanProveNotTakenFirstIteration() argument
123 assert(CurLoop->contains(CondExitBlock) && "meaning of exit block"); in CanProveNotTakenFirstIteration()
139 if (!LHS || LHS->getParent() != CurLoop->getHeader()) in CanProveNotTakenFirstIteration()
142 auto *IVStart = LHS->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in CanProveNotTakenFirstIteration()
160 const Loop *CurLoop, const BasicBlock *BB, in collectTransitivePredecessors() argument
163 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in collectTransitivePredecessors()
164 if (BB == CurLoop->getHeader()) in collectTransitivePredecessors()
173 assert(CurLoop->contains(Pred) && "Should only reach loop blocks!"); in collectTransitivePredecessors()
175 if (Pred == CurLoop->getHeader()) in collectTransitivePredecessors()
189 bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop, in allLoopPathsLeadToBlock() argument
192 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in allLoopPathsLeadToBlock()
195 if (BB == CurLoop->getHeader()) in allLoopPathsLeadToBlock()
201 collectTransitivePredecessors(CurLoop, BB, Predecessors); in allLoopPathsLeadToBlock()
237 if (CurLoop->contains(Succ) || in allLoopPathsLeadToBlock()
238 !CanProveNotTakenFirstIteration(Succ, DT, CurLoop)) in allLoopPathsLeadToBlock()
250 const Loop *CurLoop) const { in isGuaranteedToExecute()
254 if (Inst.getParent() == CurLoop->getHeader()) in isGuaranteedToExecute()
264 return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
269 const Loop *CurLoop) const { in isGuaranteedToExecute()
271 allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
275 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
276 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
279 if (BB == CurLoop->getHeader()) in doesNotWriteMemoryBefore()
285 collectTransitivePredecessors(CurLoop, BB, Predecessors); in doesNotWriteMemoryBefore()
295 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
297 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
299 doesNotWriteMemoryBefore(BB, CurLoop); in doesNotWriteMemoryBefore()