Lines Matching defs:loop

14 /// This is done by creating two versions of the same loop: one which assumes
16 /// is the original generic loop.
24 /// 1. The loop that iterates over the elements is somewhat simplified by the
31 /// be quite substantial - 3-4x is quite plausible (this includes that the loop
33 /// code, because unless the loop size is known, there will be a modulo
38 /// TODO: Should some loop content - for example calls to functions and
72 #define DEBUG_TYPE "flang-loop-versioning"
94 /// usage by the instructions immediately nested in a loop.
99 /// Some array indexing operations inside a loop cannot be transformed.
102 /// any outer loop, since this will imply the operation rewrite
103 /// in this loop.
107 // the information has been collected for the given loop.
108 void dump(fir::DoLoopOp loop) const {
112 llvm::dbgs() << "Arguments usage info for loop:\n";
113 loop.print(llvm::dbgs(), printFlags);
345 // immediately nested in a loop.
351 // if those arguments are used inside any loop.
352 func.walk([&](fir::DoLoopOp loop) {
353 mlir::Block &body = *loop.getBody();
354 auto &argsInLoop = argsInLoops[loop];
355 originalLoops.push_back(loop);
360 // Process only operations immediately nested in the current loop.
361 if (op->getParentOfType<fir::DoLoopOp>() != loop)
366 // Use the reboxed value, not the block arg when re-creating the loop.
369 // Check that the operand dominates the loop?
373 if (!domInfo.dominates(a.arg, loop))
378 // instructions referencing a.arg in the whole loop
379 // nest this loop is located in.
408 for (fir::DoLoopOp loop : originalLoops) {
409 auto &argsInLoop = argsInLoops[loop];
410 argsInLoop.dump(loop);
414 // Clear argument usage for parent loops if an inner loop
416 for (fir::DoLoopOp loop : originalLoops) {
417 auto &argsInLoop = argsInLoops[loop];
421 fir::DoLoopOp parent = loop;
426 // If an argument access can be optimized in a loop and
427 // its descendant loop, then it does not make sense to
428 // generate the contiguity check for the descendant loop.
430 // loop's transformation. So we can clear the argument
432 for (fir::DoLoopOp loop : originalLoops) {
433 auto &argsInLoop = argsInLoops[loop];
437 loop.getBody()->walk([&](fir::DoLoopOp dloop) {
444 for (fir::DoLoopOp loop : originalLoops) {
445 auto &argsInLoop = argsInLoops[loop];
446 argsInLoop.dump(loop);
459 for (fir::DoLoopOp loop : originalLoops) {
460 auto &argsInLoop = argsInLoops[loop];
464 info.op = loop;
521 LLVM_DEBUG(llvm::dbgs() << "Creating cloned loop\n");
593 // Forward the result(s), if any, from the loop operation to the
600 // Add the original loop in the else-side of the if operation.
605 // Rely on "cloned loop has results, so original loop also has results".
611 "Weird, the cloned loop doesn't have results, but the original "