@@ -2209,7 +2209,7 @@ void AffineForOp::print(OpAsmPrinter &p) {
22092209 if (getNumIterOperands () > 0 ) {
22102210 p << " iter_args(" ;
22112211 auto regionArgs = getRegionIterArgs ();
2212- auto operands = getIterOperands ();
2212+ auto operands = getInits ();
22132213
22142214 llvm::interleaveComma (llvm::zip (regionArgs, operands), p, [&](auto it) {
22152215 p << std::get<0 >(it) << " = " << std::get<1 >(it);
@@ -2331,7 +2331,7 @@ struct AffineForEmptyLoopFolder : public OpRewritePattern<AffineForOp> {
23312331 if (tripCount && *tripCount == 0 ) {
23322332 // The initial values of the iteration arguments would be the op's
23332333 // results.
2334- rewriter.replaceOp (forOp, forOp.getIterOperands ());
2334+ rewriter.replaceOp (forOp, forOp.getInits ());
23352335 return success ();
23362336 }
23372337 SmallVector<Value, 4 > replacements;
@@ -2352,7 +2352,7 @@ struct AffineForEmptyLoopFolder : public OpRewritePattern<AffineForOp> {
23522352 unsigned pos = std::distance (iterArgs.begin (), iterArgIt);
23532353 if (pos != i)
23542354 iterArgsNotInOrder = true ;
2355- replacements.push_back (forOp.getIterOperands ()[pos]);
2355+ replacements.push_back (forOp.getInits ()[pos]);
23562356 }
23572357 }
23582358 // Bail out when the trip count is unknown and the loop returns any value
@@ -2384,7 +2384,7 @@ OperandRange AffineForOp::getEntrySuccessorOperands(RegionBranchPoint point) {
23842384
23852385 // The initial operands map to the loop arguments after the induction
23862386 // variable or are forwarded to the results when the trip count is zero.
2387- return getIterOperands ();
2387+ return getInits ();
23882388}
23892389
23902390// / Given the region at `index`, or the parent operation if `index` is None,
@@ -2440,7 +2440,7 @@ LogicalResult AffineForOp::fold(FoldAdaptor adaptor,
24402440 // does not return any results. Since ops that do not return results cannot
24412441 // be folded away, we would enter an infinite loop of folds on the same
24422442 // affine.for op.
2443- results.assign (getIterOperands ().begin (), getIterOperands ().end ());
2443+ results.assign (getInits ().begin (), getInits ().end ());
24442444 folded = true ;
24452445 }
24462446 return success (folded);
@@ -2466,7 +2466,7 @@ void AffineForOp::setLowerBound(ValueRange lbOperands, AffineMap map) {
24662466
24672467 auto ubOperands = getUpperBoundOperands ();
24682468 newOperands.append (ubOperands.begin (), ubOperands.end ());
2469- auto iterOperands = getIterOperands ();
2469+ auto iterOperands = getInits ();
24702470 newOperands.append (iterOperands.begin (), iterOperands.end ());
24712471 (*this )->setOperands (newOperands);
24722472
@@ -2479,7 +2479,7 @@ void AffineForOp::setUpperBound(ValueRange ubOperands, AffineMap map) {
24792479
24802480 SmallVector<Value, 4 > newOperands (getLowerBoundOperands ());
24812481 newOperands.append (ubOperands.begin (), ubOperands.end ());
2482- auto iterOperands = getIterOperands ();
2482+ auto iterOperands = getInits ();
24832483 newOperands.append (iterOperands.begin (), iterOperands.end ());
24842484 (*this )->setOperands (newOperands);
24852485
@@ -2745,7 +2745,7 @@ AffineForOp mlir::affine::replaceForOpWithNewYields(OpBuilder &b,
27452745 // Create a new loop before the existing one, with the extra operands.
27462746 OpBuilder::InsertionGuard g (b);
27472747 b.setInsertionPoint (loop);
2748- auto operands = llvm::to_vector<4 >(loop.getIterOperands ());
2748+ auto operands = llvm::to_vector<4 >(loop.getInits ());
27492749 operands.append (newIterOperands.begin (), newIterOperands.end ());
27502750 SmallVector<Value, 4 > lbOperands (loop.getLowerBoundOperands ());
27512751 SmallVector<Value, 4 > ubOperands (loop.getUpperBoundOperands ());
0 commit comments