Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Loop

15 // have as one or more of their components the loop induction variable, it
18 // related to loop induction variables.
34 // case of post-increment users is users outside the loop.
81 #define DEBUG_TYPE "loop-reduce"
283 void initialMatch(const SCEV *S, Loop *L, ScalarEvolution &SE);
307 static void DoInitialMatch(const SCEV *S, Loop *L,
311 // Collect expressions which properly dominate the loop header.
359 /// Incorporate loop-variant parts of S into this Formula, attempting to keep
360 /// all loop-invariant and loop-computable values in a single base register.
361 void Formula::initialMatch(const SCEV *S, Loop *L, ScalarEvolution &SE) {
730 /// Return true if this AddRec is already a phi in its loop.
901 const Loop *L,
913 const Loop *L,
917 const Loop *L,
927 const Loop *L,
930 // If this is an addrec for another loop, don't second-guess its addrec phi
932 // loop at a time. LSR has already run on inner loops, will not run on outer
975 const Loop *L,
993 const Loop *L,
1019 // Determine how many (unfolded) adds we'll need inside the loop.
1098 /// variable, this variable is non-null and holds the loop associated with the
1108 /// example in an unrolled loop.
1111 bool isUseFullyOutsideLoop(const Loop *L) const;
1125 /// Test whether this fixup always uses its value outside of the given loop.
1126 bool LSRFixup::isUseFullyOutsideLoop(const Loop *L) const {
1153 for (const Loop *PIL : PostIncLoops) {
1226 /// the loop, in which case some special-case heuristics may be used.
1361 OS << ", all-fixups-outside-loop";
1640 /// This class holds state for the main loop strength reduction logic.
1647 Loop *const L;
1650 /// This is the insert position that the current loop's induction variable
1653 /// dominate all the in-loop post-increment users.
1672 // have more than a few IV increment chains in a loop. Missing a Chain falls
1787 LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE, DominatorTree &DT,
1801 /// If IV is used in a int-to-float cast inside the loop then try to eliminate
1924 /// Rewrite the loop's terminating condition if it uses a max computation.
1936 /// a C do-while loop. For example, seemingly well-behaved top-test loops
1950 /// max expression, which allows it to give the loop a canonical
1959 /// Canonical induction variables are necessary because the loop passes
1964 /// the loop has a canonical induction variable.
1967 /// can be quite costly, especially if it's inside of an outer loop.
1969 /// This function solves this problem by detecting this type of loop and
1974 // Check that the loop matches the pattern we're looking for.
2034 "Loop condition operand is an addrec in a different loop!");
2082 /// Change loop terminating condition to use the postinc iv when possible.
2093 // Get the terminating condition for the loop if possible. If we
2112 // being unable to find a sufficient guard, for example), change the loop
2173 DEBUG(dbgs() << " Change loop exiting icmp to use postinc iv: "
2176 // It's possible for the setcc instruction to be anywhere in the loop, and
2205 // Determine an insertion point for the loop induction variable increment. It
2207 // dominate the loop latch edge.
2231 // the uses will have all its uses outside the loop, for example.
2424 /// this loop) within [OI,OE) or returns OE. If IVUsers mapped Instructions to
2428 Loop *L, ScalarEvolution &SE) {
2502 /// Return true if the chain increment is profitable to expand into a loop
2618 // profitable loop invariant increment from the last link in the Chain.
2639 // The increment must be loop-invariant so it can be kept in a register.
2662 // into this loop's AddRec.
2727 /// the loop. Subsequent passes can easily "unchain" computation exposing more
2728 /// ILP *within the loop* if the target wants it.
2739 /// TODO: Walk the entire domtree within this loop, not just the path to the
2740 /// loop latch. This will discover chains on side paths, but requires
2754 // Walk the instruction stream from the loop header to the loop latch.
3034 /// loop-variant portions from loop-invariant and loop-computable portions.
3080 /// Check for other uses of loop-invariant values which we're tracking. These
3084 /// TODO: Should this give more weight to users inside the loop?
3107 // Look for instructions defined outside the loop.
3121 // Ignore instructions not dominated by the loop.
3180 const Loop *L,
3203 // does not pertain to this loop.
3252 // Loop-variant "unknown" values are uninteresting; we won't be able to
3333 /// Generate a formula consisting of all of the loop-dominating registers added
3566 // As a special-case, handle special out-of-loop Basic users specially.
4144 // With all other options exhausted, loop until the system is simple
4335 const Loop *IPLoop = LI.getLoopFor(IP->getParent());
4345 // Don't climb into a loop though.
4346 const Loop *IDomLoop = LI.getLoopFor(IDom);
4403 for (const Loop *PIL : LF.PostIncLoops) {
4406 // Be dominated by the loop exit.
4642 // is the canonical backedge for this loop, which complicates post-inc
4647 Loop *PNLoop = LI.getLoopFor(Parent);
4665 // If PN is outside of the loop and BB is in the loop, we want to
4781 LSRInstance::LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE,
4799 DEBUG(dbgs() << "LSR skipping loop, too many IV Users in " << U << "\n");
4808 // IVUsers analysis should only create users that are dominated by simple loop
4809 // headers. Since this loop should dominate all of its users, its user list
4810 // should be empty if this loop itself is not within a simple loop nest.
4814 const Loop *DomLoop = LI.getLoopFor(BB);
4816 assert(DomLoop->getLoopPreheader() && "LSR needs a simplified loop nest");
4821 DEBUG(dbgs() << "\nLSR on loop ";
4825 // First, perform some low-level loop optimizations.
4829 // If loop preparation eliminates all interesting IV users, bail.
4834 DEBUG(dbgs() << "LSR skipping outer loop " << *L << "\n");
4941 bool runOnLoop(Loop *L, LPPassManager &LPM) override;
4948 INITIALIZE_PASS_BEGIN(LoopStrengthReduce, "loop-reduce",
4949 "Loop Strength Reduction", false, false)
4956 INITIALIZE_PASS_END(LoopStrengthReduce, "loop-reduce",
4957 "Loop Strength Reduction", false, false)
4988 bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager & /*LPM*/) {