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 (const BasicBlock *BB : llvm::drop_begin(CurLoop->blocks())) { in computeLoopSafetyInfo()
68 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
79 void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) { in computeLoopSafetyInfo() argument
80 assert(CurLoop != nullptr && "CurLoop can't be null"); in computeLoopSafetyInfo()
85 for (const auto &BB : CurLoop->blocks()) in computeLoopSafetyInfo()
90 computeBlockColors(CurLoop); in computeLoopSafetyInfo()
104 void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) { in computeBlockColors() argument
107 Function *Fn = CurLoop->getHeader()->getParent(); in computeBlockColors()
119 const Loop *CurLoop) { in CanProveNotTakenFirstIteration() argument
124 assert(CurLoop->contains(CondExitBlock) && "meaning of exit block"); in CanProveNotTakenFirstIteration()
140 if (!LHS || LHS->getParent() != CurLoop->getHeader()) in CanProveNotTakenFirstIteration()
143 auto *IVStart = LHS->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in CanProveNotTakenFirstIteration()
161 const Loop *CurLoop, const BasicBlock *BB, in collectTransitivePredecessors() argument
164 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in collectTransitivePredecessors()
165 if (BB == CurLoop->getHeader()) in collectTransitivePredecessors()
174 assert(CurLoop->contains(Pred) && "Should only reach loop blocks!"); in collectTransitivePredecessors()
176 if (Pred == CurLoop->getHeader()) in collectTransitivePredecessors()
190 bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop, in allLoopPathsLeadToBlock() argument
193 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in allLoopPathsLeadToBlock()
196 if (BB == CurLoop->getHeader()) in allLoopPathsLeadToBlock()
202 collectTransitivePredecessors(CurLoop, BB, Predecessors); in allLoopPathsLeadToBlock()
207 for (const BasicBlock *Pred : predecessors(CurLoop->getHeader())) in allLoopPathsLeadToBlock()
247 if (CurLoop->contains(Succ) || in allLoopPathsLeadToBlock()
248 !CanProveNotTakenFirstIteration(Succ, DT, CurLoop)) in allLoopPathsLeadToBlock()
260 const Loop *CurLoop) const { in isGuaranteedToExecute()
264 if (Inst.getParent() == CurLoop->getHeader()) in isGuaranteedToExecute()
274 return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
279 const Loop *CurLoop) const { in isGuaranteedToExecute()
281 allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT); in isGuaranteedToExecute()
285 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
286 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
289 if (BB == CurLoop->getHeader()) in doesNotWriteMemoryBefore()
295 collectTransitivePredecessors(CurLoop, BB, Predecessors); in doesNotWriteMemoryBefore()
305 const Loop *CurLoop) const { in doesNotWriteMemoryBefore()
307 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); in doesNotWriteMemoryBefore()
309 doesNotWriteMemoryBefore(BB, CurLoop); in doesNotWriteMemoryBefore()