@@ -2087,15 +2087,16 @@ struct WarpOpScfForOp : public WarpDistributionPattern {
20872087 // escaping values in the new `WarpOp`.
20882088 SmallVector<Value> newForOpOperands;
20892089 for (size_t i = initArgsStartIdx; i < escapingValuesStartIdx; ++i)
2090- newForOpOperands.push_back (newWarpOp.getResult (i ));
2090+ newForOpOperands.push_back (newWarpOp.getResult (newIndices[i] ));
20912091
20922092 // Create a new `ForOp` outside the new `WarpOp` region.
20932093 OpBuilder::InsertionGuard g (rewriter);
20942094 rewriter.setInsertionPointAfter (newWarpOp);
20952095 auto newForOp = scf::ForOp::create (
2096- rewriter, forOp.getLoc (), /* *LowerBound=**/ newWarpOp.getResult (0 ),
2097- /* *UpperBound=**/ newWarpOp.getResult (1 ),
2098- /* *Step=**/ newWarpOp.getResult (2 ), newForOpOperands,
2096+ rewriter, forOp.getLoc (),
2097+ /* *LowerBound=**/ newWarpOp.getResult (newIndices[0 ]),
2098+ /* *UpperBound=**/ newWarpOp.getResult (newIndices[1 ]),
2099+ /* *Step=**/ newWarpOp.getResult (newIndices[2 ]), newForOpOperands,
20992100 /* bodyBuilder=*/ nullptr , forOp.getUnsignedCmp ());
21002101 // Next, we insert a new `WarpOp` (called inner `WarpOp`) inside the
21012102 // newly created `ForOp`. This `WarpOp` will contain all ops that were
0 commit comments