Lines Matching defs:loop
5 #include "src/compiler/wasm-loop-peeling.h"
10 #include "src/compiler/loop-analysis.h"
11 #include "src/compiler/loop-peeling.h"
17 void PeelWasmLoop(Node* loop_node, ZoneUnorderedSet<Node*>* loop, Graph* graph,
22 DCHECK_NOT_NULL(loop);
23 // No back-jump to the loop header means this is not really a loop.
26 uint32_t copied_size = static_cast<uint32_t>(loop->size()) * 2;
33 base::make_iterator_range(loop->begin(), loop->end()),
48 // Step 1: Create merges for loop exits.
57 // Create a merge node for the peeled iteration and main loop. Skip the
61 // Replace all uses of the loop exit with the merge node.
64 if (loop->count(use) == 1) {
65 // Uses within the loop will be LoopExitEffects and LoopExitValues.
66 // Those are used by nodes outside the loop. We need to create phis from
67 // the main loop and peeled iteration to replace loop exits.
81 // For uses outside the loop, simply redirect them to the merge.
88 // Step 2: The peeled iteration is not a loop anymore. Any control uses of
89 // its loop header should now point to its non-recursive input. Any phi uses
90 // should use the value coming from outside the loop.
102 // Step 3: Rewire the peeled iteration to flow into the main loop.
105 // merge and phis which flow from the peeled iteration into the main loop.
122 // In the main loop, change inputs to the merge and phis above.