Lines Matching refs:Loop
1 //===- LoopDistribute.cpp - Loop Distribution Pass ------------------------===//
10 // This file implements the Loop Distribution Pass. Its main focus is to
12 // tries to isolate the offending dependences into a new loop allowing
20 // Similarly to the Vectorizer, the pass also supports loop versioning to
41 #define LDIST_NAME "loop-distribute"
47 LDistVerify("loop-distribute-verify", cl::Hidden,
49 "after Loop Distribution"),
53 "loop-distribute-non-if-convertible", cl::Hidden,
54 cl::desc("Whether to distribute into a loop that may not be "
55 "if-convertible by the loop vectorizer"),
59 "loop-distribute-scev-check-threshold", cl::init(8), cl::Hidden,
60 cl::desc("The maximum number of SCEV checks allowed for Loop "
66 /// \brief Maintains the set of instructions of the loop for a partition before
67 /// cloning. After cloning, it hosts the new loop.
72 InstPartition(Instruction *I, Loop *L, bool DepCycle = false)
112 // Insert instructions from the loop that we depend on.
121 /// \brief Clones the original loop.
124 /// LoopDomBB dominates the loop.
125 Loop *cloneLoopWithPreheader(BasicBlock *InsertBefore, BasicBlock *LoopDomBB,
134 /// \brief The cloned loop. If this partition is mapped to the original loop,
136 const Loop *getClonedLoop() const { return ClonedLoop; }
138 /// \brief Returns the loop where this partition ends up after distribution.
139 /// If this partition is mapped to the original loop then use the block from
140 /// the loop.
141 const Loop *getDistributedLoop() const {
200 /// \brief The original loop.
201 Loop *OrigLoop;
203 /// \brief The cloned loop. If this partition is mapped to the original loop,
205 Loop *ClonedLoop;
208 /// partition is mapped to the original loop, this is empty.
212 /// finalized. If this partition is mapped to the original loop, these are not
223 InstPartitionContainer(Loop *L, LoopInfo *LI, DominatorTree *DT)
388 Loop *NewLoop;
391 // We're cloning the preheader along with the loop so we already made sure
396 // Create a loop for each partition except the last. Clone the original
397 // loop before PH along with adding a preheader for the cloned loop. Then
414 // preheaders with the exiting block of the previous loop. Dominance
415 // within the loop is updated in cloneLoopWithPreheader.
505 Loop *L;
588 // act of distributing a loop creates new loops and can invalidate iterators
590 SmallVector<Loop *, 8> Worklist;
592 for (Loop *TopLevelLoop : *LI)
593 for (Loop *L : depth_first(TopLevelLoop))
600 for (Loop *L : Worklist)
603 // Process each loop nest in the function.
658 /// \brief Try to distribute an inner-most loop.
659 bool processLoop(Loop *L) {
678 // Currently, we only distribute to isolate the part of the loop with
733 // partition of the load that we set up in the previous loop (see
755 // partition that we set up in the MemoryInstructionDependences loop.
763 // Don't distribute the loop if we need too many SCEV run-time checks.
770 DEBUG(dbgs() << "\nDistributing loop: " << *L << "\n");
776 // the loop. (Also split if this has no predecessor, i.e. entry, because we
781 // If we need run-time checks, version the loop now.
797 // Create identical copies of the original loop for each partition and hook
801 // Now, we remove the instruction from each loop that don't belong to that
825 static const char ldist_name[] = "Loop Distribition";