Lines Matching refs:Loop
11 // loop instruction. The hardware loop can perform loop branches with a
16 // normalizes induction variables, and the Loop Strength Reduction pass
61 cl::desc("Add a preheader to a hardware loop if one doesn't exist"));
144 /// \brief Find the register that contains the loop controlling
150 /// loop:
153 /// if (R.next < #N) goto loop
165 /// \brief Analyze the statements in a loop to determine if the loop
172 /// a loop iterates. The function takes the operands that represent the
173 /// loop start value, loop end value, and induction value. Based upon
177 /// to the loop's preheader.
178 CountValue *computeCount(MachineLoop *Loop, const MachineOperand *Start,
183 /// loop.
187 /// \brief Return true if the loop contains an instruction that inhibits
188 /// using the hardware loop.
191 /// \brief Given a loop, check if we can convert it to a hardware loop.
263 /// i.e. the comparison that controls the loop execution may be using
266 /// Return true if the loop's flow is the desired one (i.e. it's
273 /// \brief Given a loop, if it does not have a preheader, create one.
283 /// \brief Abstraction for a trip count of a loop. A smaller version
393 // value that will be added to it in each loop iteration.
524 /// \brief Analyze the statements in a loop to determine if the loop has
528 /// This function iterates over the phi nodes in the loop to check for
530 /// the number of time the loop is executed.
536 "Loop must have more than one incoming edge!");
538 if (PI == TopMBB->pred_end()) // dead loop?
590 // the header. Otherwise, branch to TB could be exiting the loop, and
626 // The comparison operator type determines how we compute the loop
681 /// number of times a loop iterates. The function takes the operands that
682 /// represent the loop start value, loop end value, and induction value.
684 CountValue *HexagonHardwareLoops::computeCount(MachineLoop *Loop,
720 // Loop going while iv is "less" with the iv value going down. Must wrap.
724 // Loop going while iv is "greater" with the iv value going up. Must wrap.
727 // Phis that may feed into the loop.
732 // the loop counter, so we shouldn't generate a hardware loop in this case.
733 if (loopCountMayWrapOrUnderFlow(Start, End, Loop->getLoopPreheader(), Loop,
759 // For the loop to iterate, CmpLess should imply Dist > 0. Similarly,
788 MachineBasicBlock *PH = Loop->getLoopPreheader();
799 // If the loop IV is going downwards, i.e. if the bump is negative,
885 // If the loop has been unrolled, we should use the original loop count
946 /// \brief Return true if the operation is invalid within hardware loop.
950 // Call is not allowed because the callee may use a hardware loop except for
955 // Check if the instruction defines a hardware loop register.
970 /// \brief Return true if the loop contains an instruction that inhibits
971 /// the use of the hardware loop instruction.
1076 /// \brief Check if the loop is a candidate for converting to a hardware
1077 /// loop. If so, then perform the transformation.
1079 /// This function works on innermost loops first. A loop can be converted
1080 /// if it is a counting loop; either a register value or an immediate.
1082 /// The code makes several assumptions about the representation of the loop
1088 assert(L->getHeader() && "Loop without a header?");
1101 // If a nested loop has been converted, then we can't convert this loop.
1110 // 1 - Hardware loop is being generated for the inner most loop.
1111 // 0 - Hardware loop is being generated for the outer loop.
1135 // Does the loop contain any invalid instructions?
1140 // Don't generate hw loop if the loop has more than one exit.
1152 // Ensure the loop has a preheader: the loop instruction will be
1164 // Are we able to determine the trip count for the loop?
1179 // Determine the loop start.
1200 // Convert the loop to a hardware loop.
1201 DEBUG(dbgs() << "Change to hardware loop at "; L->dump());
1207 // Create a copy of the loop count register.
1211 // Add the Loop instruction to the beginning of the loop.
1216 // Add the Loop immediate instruction to the beginning of the loop,
1231 // Make sure the loop start always has a reference in the CFG. We need
1239 // Replace the loop branch with an endloop instruction.
1243 // The loop ends with either:
1245 // - a conditional branch to the loop start.
1248 // Delete one and change/add an uncond. branch to out of the loop.
1258 // Conditional branch to loop start; just delete it.
1270 // Set RecL1used and RecL0used only after hardware loop has been
1271 // successfully generated. Doing it earlier can cause wrong loop instruction
1273 if (L0Used) // Loop0 was already used. So, the correct loop must be loop1.
1319 /// This function is required to break recursion. Visiting phis in a loop may
1331 // Ignore all BBs that form Loop.
1363 /// first itertion of a do-while loop. In this case, we cannot generate a
1364 /// hardware loop because the endloop instruction does not decrement the loop
1371 /// zero by perfoming a crude analysis of the loop counter. This function
1372 /// checks if the initial value is used in any comparison prior to the loop
1413 // in a compare, then we assume this is a range check that ensures the loop
1634 // unconditional branch to the loop header.
1647 // it could result in an infinite loop after conversion to hw_loop.
1808 /// \brief Create a preheader for a given loop.
1855 // the loop latch. Any additional predecessors of the header should