Lines Matching defs:loops
158 /// Checks if any of the tiled loops are not parallel.
164 "expected as many tile size values as number of loops");
246 /// innermost loop body of the generated tiled loops corresponds to.
336 /// Function to return the bounds of the loops to be generated.
389 /// - `tileSizes` is the tile sizes to use. Zero represent untiled loops.
394 /// - `loops` is an in-out parameter into which the generated loops are
400 SmallVector<LoopLikeOpInterface> &loops) {
422 loops.push_back(loop);
435 if (loops.empty())
455 // Add the scf.yield operations for all the outer loops.
457 llvm::zip_equal(MutableArrayRef(loops).drop_back(),
458 MutableArrayRef(loops).drop_front())) {
468 /// - `tileSizes` is the tile sizes to use. Zero represent untiled loops.
475 /// - `loops` is an in-out parameter into which the generated loops are
481 YieldTiledValuesFn tiledBodyFn, SmallVector<LoopLikeOpInterface> &loops) {
513 loops.push_back(forallOp);
542 /// - `tileSizes` is the tile sizes to use. Zero represent untiled loops.
547 /// - `loops` is an in-out parameter into which the generated loops are
553 YieldTiledValuesFn tiledBodyFn, SmallVector<LoopLikeOpInterface> &loops) {
554 // If the tile sizes are all zero, no loops are generated. Just call the
564 destinationTensors, tiledBodyFn, loops);
569 destinationTensors, tiledBodyFn, loops);
721 /// loops existing `init` operands (or similar), and replace `loopOp` with
860 /// Method to add new init values to a loop nest. Updates `loops` in-place
861 /// with new loops that use the `newInitValues`. The outer-loops are updated
866 RewriterBase &rewriter, MutableArrayRef<LoopLikeOpInterface> loops,
869 if (loops.empty())
872 rewriter.setInsertionPoint(loops.front());
875 for (auto &loop : loops.drop_back()) {
878 // if loops.size() > 1 we assume that scf.for is used for the loops.
889 // Merge the body of the new loop with the body of the old loops.
905 LoopLikeOpInterface innerMostLoop = loops.back();
912 loops.back() = newInnerMostLoop.value();
914 // Make all other loops except the innermost loops yield the values returned
917 llvm::zip_equal(loops.drop_back(), loops.drop_front())) {
918 // Again assume that all the outer loops are scf.for operations.
945 // 1. Get the range of the loops that are represented by the operation.
1055 // 7. Generate the tiled loops nest using the callback defined above.
1056 SmallVector<LoopLikeOpInterface> loops;
1059 innerYieldTiledValuesFn, loops)))
1060 return op.emitOpError("failed to generate tiling loops");
1065 if (loops.empty()) {
1066 // If loops are empty, the tiled op is used as the replacement for the
1070 partialResults = llvm::map_to_vector(loops.front()->getResults(),
1081 return scf::SCFTilingResult{tilingResult->tiledOps, initTensors, loops,
1113 /// method traverses the tile loop nest (`loops`) if needed, and returns the
1120 ArrayRef<LoopLikeOpInterface> loops) {
1122 auto loopIt = loops.rbegin();
1130 if (loopIt == loops.rend())
1140 MutableArrayRef<LoopLikeOpInterface> loops) {
1145 loops);
1242 isa<DestinationStyleOpInterface>(fusableProducerOp) && !loops.empty()) {
1243 loops.front()
1256 MutableArrayRef<LoopLikeOpInterface> loops,
1258 if (loops.empty())
1373 if (failed(addInitOperandsToLoopNest(rewriter, loops, initValueList,
1552 // If there are no loops generated, fusion is immaterial.
1553 auto &loops = tilingResult->loops;
1554 if (loops.empty()) {
1555 return scf::SCFTileAndFuseResult{fusedProducers, tiledAndFusedOps, loops,
1594 loops);
1611 loops);
1626 fusedResult.value(), loops);
1635 replacements[result] = loops.front()->getResult(
1636 loops.front()->getNumResults() -
1651 return scf::SCFTileAndFuseResult{fusedProducers, tiledAndFusedOps, loops,
1847 /// Find the perfectly nested loops outside of given loop(included) sorted
1862 /// This function will return three perfectly nested loops: %0 + %1 + %2, when
1985 // top-level loop is the outer-most one of these nested loops.
2165 // 14. Add new inits to [nested] loops.
2200 op, "unable to lower to loops operations with return values");
2205 SmallVector<scf::ForOp> loops;
2216 loops.push_back(loop);
2223 return loops;