Lines Matching refs:Loop
1 //===- LoopLoadElimination.cpp - Loop Load Elimination Pass ---------------===//
10 // This file implement a loop-aware load elimination pass.
12 // It uses LoopAccessAnalysis to identify loop-carried dependences with a
17 // The pass can also version the loop and add memchecks in order to prove that
34 #define LLE_OPTION "loop-load-elim"
40 "runtime-check-per-loop-load-elim", cl::Hidden,
45 "loop-load-elimination-scev-check-threshold", cl::init(8), cl::Hidden,
46 cl::desc("The maximum number of SCEV checks allowed for Loop "
103 bool doesStoreDominatesAllLatches(BasicBlock *StoreBlock, Loop *L,
113 /// \brief The per-loop class that does most of the work.
116 LoadEliminationForLoop(Loop *L, LoopInfo *LI, const LoopAccessInfo &LAI,
120 /// \brief Look through the loop-carried and loop-independent dependences in
121 /// this loop and find store->load dependences.
123 /// Note that no candidate is returned if LAA has failed to analyze the loop
187 /// Here, we rely on LAA to include the relevant loop-independent dependences.
192 /// to provide us with loop-independent dependences for the cases we're
193 /// interested. Consider the case for example where a loop-independent
303 // of the loop, then from the beginning of the loop until the last
359 // loop:
368 // loop:
369 // %x.storeforward = phi [%x.initial, %ph] [%y, %loop]
389 /// \brief Top-level driver for each loop: find store->load forwarding
397 // loop:
406 // loop:
407 // %x.storeforward = phi [%x.initial, %ph] [%y, %loop]
432 // Make sure that the stored values is available everywhere in the loop in
445 << ". Valid store-to-load forwarding across the loop backedge\n");
468 // Point of no-return, start the transformation. First, version the loop if
489 Loop *L;
502 /// \brief The pass. Most of the work is delegated to the per-loop
516 // act of distributing a loop creates new loops and can invalidate iterators
518 SmallVector<Loop *, 8> Worklist;
520 for (Loop *TopLevelLoop : *LI)
521 for (Loop *L : depth_first(TopLevelLoop))
528 for (Loop *L : Worklist) {
535 // Process each loop nest in the function.
553 static const char LLE_name[] = "Loop Load Elimination";