Lines Matching defs:AffineForOp
44 getCleanupLoopLowerBound(AffineForOp forOp, unsigned unrollFactor,
102 static void replaceIterArgsAndYieldResults(AffineForOp forOp) {
118 LogicalResult mlir::affine::promoteIfSingleIteration(AffineForOp forOp) {
174 static AffineForOp generateShiftedLoop(
177 unsigned offset, AffineForOp srcForOp, OpBuilder b) {
185 b.create<AffineForOp>(srcForOp.getLoc(), lbOperands, lbMap, ubOperands,
214 return AffineForOp();
229 LogicalResult mlir::affine::affineForOpBodySkew(AffineForOp forOp,
278 AffineForOp prologue, epilogue;
298 AffineForOp res;
317 AffineForOp::getCanonicalizationPatterns(patterns, res.getContext());
361 checkIfHyperRectangular(MutableArrayRef<AffineForOp> input) {
382 static LogicalResult performPreTilingChecks(MutableArrayRef<AffineForOp> input,
387 [](AffineForOp op) { return op.getNumResults() > 0; })) {
406 /// Move the loop body of AffineForOp 'src' from 'src' into the specified
408 static void moveLoopBodyImpl(AffineForOp src, AffineForOp dest,
415 /// Move the loop body of AffineForOp 'src' from 'src' to the start of dest
417 static void moveLoopBody(AffineForOp src, AffineForOp dest) {
423 static void constructTiledLoopNest(MutableArrayRef<AffineForOp> origLoops,
424 AffineForOp rootAffineForOp, unsigned width,
425 MutableArrayRef<AffineForOp> tiledLoops) {
430 AffineForOp innermostPointLoop;
436 AffineForOp pointLoop = b.create<AffineForOp>(loc, 0, 0);
450 AffineForOp tileSpaceLoop = b.create<AffineForOp>(loc, 0, 0);
464 static void setIntraTileBoundsParametric(OpBuilder &b, AffineForOp origLoop,
465 AffineForOp newInterTileLoop,
466 AffineForOp newIntraTileLoop,
559 static void setInterTileBoundsParametric(OpBuilder &b, AffineForOp origLoop,
560 AffineForOp newLoop, Value tileSize) {
661 MutableArrayRef<AffineForOp> origLoops,
662 MutableArrayRef<AffineForOp> newLoops, ArrayRef<Value> tileSizes) {
688 constructTiledIndexSetHyperRect(MutableArrayRef<AffineForOp> origLoops,
689 MutableArrayRef<AffineForOp> newLoops,
772 mlir::affine::tilePerfectlyNested(MutableArrayRef<AffineForOp> input,
774 SmallVectorImpl<AffineForOp> *tiledNest) {
781 MutableArrayRef<AffineForOp> origLoops = input;
782 AffineForOp rootAffineForOp = origLoops[0];
786 SmallVector<AffineForOp, 6> tiledLoops(2 * width);
815 MutableArrayRef<AffineForOp> input, ArrayRef<Value> tileSizes,
816 SmallVectorImpl<AffineForOp> *tiledNest) {
823 MutableArrayRef<AffineForOp> origLoops = input;
824 AffineForOp rootAffineForOp = origLoops[0];
826 SmallVector<AffineForOp, 6> tiledLoops(2 * width);
855 /// AffineForOp, and the second op is a terminator).
857 SmallVectorImpl<AffineForOp> &nestedLoops, AffineForOp root) {
864 root = dyn_cast<AffineForOp>(&body.front());
874 func::FuncOp f, std::vector<SmallVector<AffineForOp, 6>> *bands) {
877 for (AffineForOp forOp : f.getOps<AffineForOp>()) {
878 SmallVector<AffineForOp, 6> band;
885 LogicalResult mlir::affine::loopUnrollFull(AffineForOp forOp) {
900 LogicalResult mlir::affine::loopUnrollUpToFactor(AffineForOp forOp,
909 /// Generates unrolled copies of AffineForOp 'loopBodyBlock', with associated
974 static LogicalResult generateCleanupLoopForUnroll(AffineForOp forOp,
978 auto cleanupForOp = cast<AffineForOp>(builder.clone(*forOp));
1010 AffineForOp forOp, uint64_t unrollFactor,
1076 LogicalResult mlir::affine::loopUnrollJamUpToFactor(AffineForOp forOp,
1087 static bool areInnerBoundsInvariant(AffineForOp forOp) {
1088 auto walkResult = forOp.walk([&](AffineForOp aForOp) {
1099 LogicalResult mlir::affine::loopUnrollJamByFactor(AffineForOp forOp,
1127 JamBlockGatherer<AffineForOp> jbg;
1132 SmallVector<AffineForOp, 4> loopsWithIterArgs;
1133 forOp.walk([&](AffineForOp aForOp) {
1165 SmallVector<AffineForOp, 4> newLoopsWithIterArgs;
1167 for (AffineForOp oldForOp : loopsWithIterArgs) {
1182 AffineForOp newForOp =
1183 cast<AffineForOp>(*oldForOp.replaceWithAdditionalYields(
1295 void mlir::affine::interchangeLoops(AffineForOp forOpA, AffineForOp forOpB) {
1320 ArrayRef<AffineForOp> loops, ArrayRef<unsigned> loopPermMap) {
1353 ArrayRef<AffineForOp> loops, ArrayRef<unsigned> loopPermMap) {
1366 mlir::affine::isPerfectlyNested(ArrayRef<AffineForOp> loops) {
1377 auto parentForOp = dyn_cast<AffineForOp>(loop->getParentOp());
1388 unsigned mlir::affine::permuteLoops(ArrayRef<AffineForOp> input,
1415 Block *destBody = ((AffineForOp)input[invPermMap.back().second]).getBody();
1416 Block *srcBody = ((AffineForOp)input.back()).getBody();
1446 auto *destBody = ((AffineForOp)input[parentPosInInput]).getBody();
1458 AffineForOp mlir::affine::sinkSequentialLoops(AffineForOp forOp) {
1459 SmallVector<AffineForOp, 4> loops;
1533 static SmallVector<AffineForOp, 8>
1534 stripmineSink(AffineForOp forOp, uint64_t factor,
1535 ArrayRef<AffineForOp> targets) {
1554 SmallVector<AffineForOp, 8> innerLoops;
1558 auto newForOp = b.create<AffineForOp>(t.getLoc(), lbOperands, lbMap,
1577 static AffineForOp stripmineSink(AffineForOp forOp, SizeType factor,
1578 AffineForOp target) {
1583 auto res = stripmineSink(forOp, factor, ArrayRef<AffineForOp>(target));
1588 SmallVector<SmallVector<AffineForOp, 8>, 8>
1589 mlir::affine::tile(ArrayRef<AffineForOp> forOps, ArrayRef<uint64_t> sizes,
1590 ArrayRef<AffineForOp> targets) {
1591 SmallVector<SmallVector<AffineForOp, 8>, 8> res;
1592 SmallVector<AffineForOp, 8> currentTargets(targets);
1601 SmallVector<AffineForOp, 8> mlir::affine::tile(ArrayRef<AffineForOp> forOps,
1603 AffineForOp target) {
1604 SmallVector<AffineForOp, 8> res;
1605 for (auto loops : tile(forOps, sizes, ArrayRef<AffineForOp>(target))) {
1612 LogicalResult mlir::affine::coalesceLoops(MutableArrayRef<AffineForOp> loops) {
1616 AffineForOp innermost = loops.back();
1617 AffineForOp outermost = loops.front();
1622 for (AffineForOp loop : loops) {
1642 for (AffineForOp loop : loops.drop_front()) {
1717 AffineForOp secondOutermostLoop = loops[1];
1775 SmallVector<AffineForOp, 4> enclosingFors;
1832 /// returns the outermost AffineForOp of the copy loop nest. `lbMaps` and
1845 static AffineForOp
1865 AffineForOp copyNestRoot;
2252 SmallVector<AffineForOp, 4> ivs;
2447 AffineForOp forOp;
2448 if (llvm::DebugFlag && (forOp = dyn_cast<AffineForOp>(&*begin))) {
2464 // an AffineForOp.
2466 AffineForOp forOp, const AffineCopyOptions ©Options,
2502 std::vector<SmallVector<AffineForOp, 2>> &depthToLoops) {
2509 if (auto forOp = dyn_cast<AffineForOp>(op)) {
2518 func::FuncOp func, std::vector<SmallVector<AffineForOp, 2>> &depthToLoops) {
2529 AffineForOp mlir::affine::createCanonicalizedAffineForOp(
2542 return b.create<AffineForOp>(loc, lowerOperands, lbMap, upperOperands, ubMap,
2551 static AffineIfOp createSeparationCondition(MutableArrayRef<AffineForOp> loops,
2631 createFullTiles(MutableArrayRef<AffineForOp> inputNest,
2632 SmallVectorImpl<AffineForOp> &fullTileLoops, OpBuilder b) {
2667 AffineForOp fullTileLoop = createCanonicalizedAffineForOp(
2686 mlir::affine::separateFullTiles(MutableArrayRef<AffineForOp> inputNest,
2687 SmallVectorImpl<AffineForOp> *fullTileNest) {
2701 SmallVector<AffineForOp, 4> fullTileLoops;
2721 AffineForOp outermostFullTileLoop = fullTileLoops[0];
2740 LogicalResult affine::coalescePerfectlyNestedAffineLoops(AffineForOp op) {
2742 SmallVector<AffineForOp> loops;