Lines Matching defs:CurLoop
49 void SimpleLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) {
50 assert(CurLoop != nullptr && "CurLoop can't be null");
51 BasicBlock *Header = CurLoop->getHeader();
58 assert(Header == *CurLoop->getBlocks().begin() &&
60 for (const BasicBlock *BB : llvm::drop_begin(CurLoop->blocks())) {
66 computeBlockColors(CurLoop);
77 void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) {
78 assert(CurLoop != nullptr && "CurLoop can't be null");
83 for (const auto &BB : CurLoop->blocks())
88 computeBlockColors(CurLoop);
102 void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) {
105 Function *Fn = CurLoop->getHeader()->getParent();
117 const Loop *CurLoop) {
122 assert(CurLoop->contains(CondExitBlock) && "meaning of exit block");
139 if (!LHS || LHS->getParent() != CurLoop->getHeader()) {
143 if (!LHS || LHS->getParent() != CurLoop->getHeader())
148 auto *IVStart = LHS->getIncomingValueForBlock(CurLoop->getLoopPreheader());
160 /// Collect all blocks from \p CurLoop which lie on all possible paths from
161 /// the header of \p CurLoop (inclusive) to BB (exclusive) into the set
165 /// \p CurLoop. We only return Predecessors that are a part of \p CurLoop.
167 const Loop *CurLoop, const BasicBlock *BB,
170 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!");
171 if (BB == CurLoop->getHeader())
175 if (!CurLoop->contains(Pred))
182 assert(CurLoop->contains(Pred) && "Should only reach loop blocks!");
184 if (Pred == CurLoop->getHeader())
186 // TODO: If BB lies in an inner loop of CurLoop, this will traverse over all
193 if (CurLoop->contains(PredPred) && Predecessors.insert(PredPred).second)
198 bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop,
201 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!");
204 if (BB == CurLoop->getHeader())
210 collectTransitivePredecessors(CurLoop, BB, Predecessors);
215 for (const BasicBlock *Pred : predecessors(CurLoop->getHeader()))
255 if (CurLoop->contains(Succ) ||
256 !CanProveNotTakenFirstIteration(Succ, DT, CurLoop))
268 const Loop *CurLoop) const {
272 if (Inst.getParent() == CurLoop->getHeader())
282 return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT);
287 const Loop *CurLoop) const {
289 allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT);
293 const Loop *CurLoop) const {
294 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!");
297 if (BB == CurLoop->getHeader())
303 collectTransitivePredecessors(CurLoop, BB, Predecessors);
313 const Loop *CurLoop) const {
315 assert(CurLoop->contains(BB) && "Should only be called for loop blocks!");
317 doesNotWriteMemoryBefore(BB, CurLoop);