@@ -157,8 +157,8 @@ struct WgToSgCreateNdOp : public OpConversionPattern<xegpu::CreateNdDescOp> {
157157 if (computeProduct (sgLayout) != sgCount)
158158 return rewriter.notifyMatchFailure (
159159 op, " sg_layout size must match the sg_id_range" );
160- // Subtract startOfRange from the original subgroup id to get the adjusted
161- // sg id
160+ // Subtract startOfRange from the original subgroup id to get
161+ // the adjusted sg id
162162 Value startOfRangeVal =
163163 rewriter.create <arith::ConstantIndexOp>(loc, startOfRange);
164164 linearSgId =
@@ -176,17 +176,17 @@ struct WgToSgCreateNdOp : public OpConversionPattern<xegpu::CreateNdDescOp> {
176176 layout.dropSgLayoutAndData ());
177177
178178 SmallVector<Value> newCreateNdOps;
179- SmallVector<OpFoldResult> offset = op.getMixedOffsets ();
179+ SmallVector<OpFoldResult> oldOffsets = op.getMixedOffsets ();
180180
181- for (auto tdescOffset : *maybeTdescOffsets) {
181+ for (auto tdescOffsets : *maybeTdescOffsets) {
182182 SmallVector<OpFoldResult> newOffsets;
183- size_t rank = tdescOffset .size ();
183+ size_t rank = tdescOffsets .size ();
184184 for (size_t i = 0 ; i < rank; i++) {
185- size_t idx = offset .size () - rank + i;
186- Value newOff = rewriter.createOrFold <index::AddOp>(
187- loc, tdescOffset [i],
188- getValueOrCreateConstantIndexOp (rewriter, loc, offset [idx]));
189- newOffsets.push_back (newOff );
185+ size_t idx = oldOffsets .size () - rank + i;
186+ Value add = rewriter.createOrFold <index::AddOp>(
187+ loc, tdescOffsets [i],
188+ getValueOrCreateConstantIndexOp (rewriter, loc, oldOffsets [idx]));
189+ newOffsets.push_back (add );
190190 }
191191
192192 auto newOp = xegpu::CreateNdDescOp::create (
0 commit comments