Lines Matching refs:CurLoop
54 void SimpleLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) { in computeLoopSafetyInfo() argument
55 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
56 BasicBlock *Header = CurLoop->getHeader(); in computeLoopSafetyInfo()
63 assert(Header == *CurLoop->getBlocks().begin() && in computeLoopSafetyInfo()
65 for (Loop::block_iterator BB = std::next(CurLoop->block_begin()), in computeLoopSafetyInfo()
66 BBE = CurLoop->block_end(); in computeLoopSafetyInfo()
70 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
81 void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) { in computeLoopSafetyInfo() argument
82 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
87 for (auto &BB : CurLoop->blocks()) in computeLoopSafetyInfo()
92 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
106 void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) { in computeBlockColors() argument
109 Function *Fn = CurLoop->getHeader()->getParent(); in computeBlockColors()
121 const Loop *CurLoop) { in CanProveNotTakenFirstIteration() argument
126 assert(CurLoop->contains(CondExitBlock) && "meaning of exit block"); in CanProveNotTakenFirstIteration()
142 if (!LHS || LHS->getParent() != CurLoop->getHeader()) in CanProveNotTakenFirstIteration()
145 auto *IVStart = LHS->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in CanProveNotTakenFirstIteration()
163 const Loop *CurLoop, const BasicBlock *BB, in collectTransitivePredecessors() argument
166 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in collectTransitivePredecessors()
167 if (BB == CurLoop->getHeader()) in collectTransitivePredecessors()
176 assert(CurLoop->contains(Pred) && "Should only reach loop blocks!"); in collectTransitivePredecessors()
178 if (Pred == CurLoop->getHeader()) in collectTransitivePredecessors()
192 bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop, in allLoopPathsLeadToBlock() argument
195 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in allLoopPathsLeadToBlock()
198 if (BB == CurLoop->getHeader()) in allLoopPathsLeadToBlock()
204 collectTransitivePredecessors(CurLoop, BB, Predecessors); in allLoopPathsLeadToBlock()
240 if (CurLoop->contains(Succ) || in allLoopPathsLeadToBlock()
241 !CanProveNotTakenFirstIteration(Succ, DT, CurLoop)) in allLoopPathsLeadToBlock()
253 const Loop *CurLoop) const { in isGuaranteedToExecute()
257 if (Inst.getParent() == CurLoop->getHeader()) in isGuaranteedToExecute()
267 return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
272 const Loop *CurLoop) const { in isGuaranteedToExecute()
274 allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
278 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
279 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
282 if (BB == CurLoop->getHeader()) in doesNotWriteMemoryBefore()
288 collectTransitivePredecessors(CurLoop, BB, Predecessors); in doesNotWriteMemoryBefore()
298 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
300 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
302 doesNotWriteMemoryBefore(BB, CurLoop); in doesNotWriteMemoryBefore()