Lines Matching refs:CurLoop

45 void SimpleLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) {  in computeLoopSafetyInfo()  argument
46 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
47 BasicBlock *Header = CurLoop->getHeader(); in computeLoopSafetyInfo()
54 assert(Header == *CurLoop->getBlocks().begin() && in computeLoopSafetyInfo()
56 for (Loop::block_iterator BB = std::next(CurLoop->block_begin()), in computeLoopSafetyInfo()
57 BBE = CurLoop->block_end(); in computeLoopSafetyInfo()
61 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
72 void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) { in computeLoopSafetyInfo() argument
73 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
78 for (auto &BB : CurLoop->blocks()) in computeLoopSafetyInfo()
83 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
97 void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) { in computeBlockColors() argument
100 Function *Fn = CurLoop->getHeader()->getParent(); in computeBlockColors()
112 const Loop *CurLoop) { in CanProveNotTakenFirstIteration() argument
117 assert(CurLoop->contains(CondExitBlock) && "meaning of exit block"); in CanProveNotTakenFirstIteration()
133 if (!LHS || LHS->getParent() != CurLoop->getHeader()) in CanProveNotTakenFirstIteration()
136 auto *IVStart = LHS->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in CanProveNotTakenFirstIteration()
154 const Loop *CurLoop, const BasicBlock *BB, in collectTransitivePredecessors() argument
157 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in collectTransitivePredecessors()
158 if (BB == CurLoop->getHeader()) in collectTransitivePredecessors()
167 assert(CurLoop->contains(Pred) && "Should only reach loop blocks!"); in collectTransitivePredecessors()
169 if (Pred == CurLoop->getHeader()) in collectTransitivePredecessors()
183 bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop, in allLoopPathsLeadToBlock() argument
186 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in allLoopPathsLeadToBlock()
189 if (BB == CurLoop->getHeader()) in allLoopPathsLeadToBlock()
195 collectTransitivePredecessors(CurLoop, BB, Predecessors); in allLoopPathsLeadToBlock()
224 if (CurLoop->contains(Succ) || in allLoopPathsLeadToBlock()
225 !CanProveNotTakenFirstIteration(Succ, DT, CurLoop)) in allLoopPathsLeadToBlock()
237 const Loop *CurLoop) const { in isGuaranteedToExecute()
241 if (Inst.getParent() == CurLoop->getHeader()) in isGuaranteedToExecute()
251 return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
256 const Loop *CurLoop) const { in isGuaranteedToExecute()
258 allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
262 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
263 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
266 if (BB == CurLoop->getHeader()) in doesNotWriteMemoryBefore()
272 collectTransitivePredecessors(CurLoop, BB, Predecessors); in doesNotWriteMemoryBefore()
282 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
284 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
286 doesNotWriteMemoryBefore(BB, CurLoop); in doesNotWriteMemoryBefore()