Lines Matching refs:Loop
9 // The InductiveRangeCheckElimination pass splits a loop's iteration space into
10 // three disjoint ranges. It does that in a way such that the loop running in
11 // the middle loop provably does not need range checks. As an example, it will
74 static cl::opt<unsigned> LoopSizeCutoff("irce-loop-size-cutoff", cl::Hidden,
90 /// An inductive range check is conditional branch in a loop with
98 /// taken by the containing loop's induction variable.
125 static RangeCheckKind parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
130 parseRangeCheck(Loop *L, ScalarEvolution &SE, Value *Condition,
199 Loop *L, ScalarEvolution &SE,
221 bool runOnLoop(Loop *L, LPPassManager &LPM) override;
266 InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
333 InductiveRangeCheck::parseRangeCheck(Loop *L, ScalarEvolution &SE,
392 Loop *L, ScalarEvolution &SE,
434 // Keeps track of the structure of a loop. This is similar to llvm::Loop,
435 // except that it is more lightweight and can track the state of a loop through
446 // successor is `LatchExit', the exit block of the loop.
478 Loop &,
483 /// The algorithm this class implements is given a Loop and a range [Begin,
484 /// End). The algorithm then tries to break out a "main loop" out of the loop
485 /// it is given in a way that the "main loop" runs with the induction variable
487 /// loops to run any remaining iterations. The pre loop runs any iterations in
488 /// which the induction variable is < Begin, and the post loop runs any
492 // The representation of a clone of the original loop we started out with.
500 // An instance of `LoopStructure` for the cloned loop
504 // Result of rewriting the range of a loop. See changeIterationSpaceEnd for
516 // Calculated subranges we restrict the iteration space of the main loop to.
519 // on low end of the restricted iteration space of the main loop. `HighLimit`
521 // space of the main loop.
534 // Compute a safe set of limits for the main loop to run in -- effectively the
535 // intersection of `Range' and the iteration space of the original loop.
547 // Rewrite the iteration space of the loop denoted by (LS, Preheader). The
548 // iteration space of the rewritten loop ends at ExitLoopAt. The start of the
553 // `ContinuationBlock', otherwise they take the normal loop exit. The
559 // .ExitSelector is a basic block that decides, on exit from the loop,
563 // for each PHINode in the loop header on taking the pseudo exit.
566 // preheader because it is made to branch to the loop header only
574 // The loop denoted by `LS' has `OldPreheader' as its preheader. This
581 // `changeIterationSpaceEnd' and is the preheader to the loop denoted by `LS'.
589 // keep the parent loop structure consistent. The `LPPassManager' seems to
590 // verify this after running a loop pass. This function adds the list of
591 // blocks denoted by BBs to this loops parent loop if required.
599 // Information about the original loop we started out with.
600 Loop &OriginalLoop;
605 // The preheader of the main loop. This may or may not be different from
609 // The range we need to run the main loop in.
612 // The structure of the main loop (see comment at the beginning of this class
617 LoopConstrainer(Loop &L, LoopInfo &LI, const LoopStructure &LS,
653 Loop &L, const char *&FailureReason) {
658 FailureReason = "no loop latch";
681 FailureReason = "short running loop, not profitable";
830 "loop variant exit count doesn't make sense!");
892 // the loop body is actually executed with is `INT_SMIN` == `Smallest`.
908 // In some cases we can prove that we don't need a pre or post loop
954 // the loop is in LCSSA.
978 // We start with a loop with a single latch:
1096 // each of the PHI nodes in the loop header. This feeds into the initial
1169 Loop *ParentLoop = OriginalLoop.getParentLoop();
1312 // variable, that may or may not exist as a real llvm::Value in the loop) and
1394 bool InductiveRangeCheckElimination::runOnLoop(Loop *L, LPPassManager &LPM) {
1396 DEBUG(dbgs() << "irce: giving up constraining loop, too large\n";);
1402 DEBUG(dbgs() << "irce: loop has no preheader, leaving\n");
1423 OS << "irce: looking at loop "; L->print(OS);
1424 OS << "irce: loop has " << RangeChecks.size()
1439 DEBUG(dbgs() << "irce: could not parse loop structure: " << FailureReason