@@ -907,22 +907,22 @@ struct StoreDistribution final : public gpu::WarpDistributionPattern {
907907 }
908908};
909909
910- static SmallVector<Value> computeDistributedOffsetsForMatrixOp (
910+ static SmallVector<Value> computeDistributedCoordinatesForMatrixOp (
911911 PatternRewriter &rewriter, Location loc, xegpu::DistributeLayoutAttr layout,
912912 Value laneId, ArrayRef<int64_t > payloadShape, ValueRange origOffsets) {
913- SmallVector<Value> newOffsets ;
914- auto maybeDescOffsets =
915- layout.computeDistributedOffsets (rewriter, loc, laneId, payloadShape);
916- if (failed (maybeDescOffsets ))
913+ SmallVector<Value> newCoods ;
914+ auto maybeCoords =
915+ layout.computeDistributedCoords (rewriter, loc, laneId, payloadShape);
916+ if (failed (maybeCoords ))
917917 return {};
918- assert (maybeDescOffsets .value ().size () == 1 &&
918+ assert (maybeCoords .value ().size () == 1 &&
919919 " Expected one set of distributed offsets" );
920920 SmallVector<OpFoldResult> ofrVec = xegpu::addWithRightAligned (
921- rewriter, loc, getAsOpFoldResult (maybeDescOffsets .value ()[0 ]),
921+ rewriter, loc, getAsOpFoldResult (maybeCoords .value ()[0 ]),
922922 getAsOpFoldResult (origOffsets));
923- newOffsets = llvm::to_vector (llvm::map_range (
923+ newCoods = llvm::to_vector (llvm::map_range (
924924 ofrVec, [&](OpFoldResult ofr) -> Value { return cast<Value>(ofr); }));
925- return newOffsets ;
925+ return newCoods ;
926926}
927927
928928// / Pattern for distributing xegpu::LoadMatrixOp.
@@ -969,7 +969,7 @@ struct LoadMatrixDistribution final : public gpu::WarpDistributionPattern {
969969 getDistVecTypeBasedOnLaneLayout (layout, sgPayloadTy);
970970 if (failed (distPayloadByWarpOpOrFailure))
971971 return rewriter.notifyMatchFailure (
972- matrixOp, " The matrix op payload has no layout." );
972+ matrixOp, " Failed to distribute matrix op payload based on layout." );
973973
974974 SmallVector<Value> operands = {matrixOp.getMemDesc ()};
975975 const unsigned offsetsStartIdx = operands.size ();
@@ -992,17 +992,17 @@ struct LoadMatrixDistribution final : public gpu::WarpDistributionPattern {
992992 ValueRange currentOffsets =
993993 ValueRange (newOperands).drop_front (offsetsStartIdx);
994994
995- SmallVector<Value> newOffsets = currentOffsets;
995+ SmallVector<Value> newCoords = currentOffsets;
996996 rewriter.setInsertionPointAfter (newWarpOp);
997997
998998 if (!matrixOp.getSubgroupBlockIoAttr ()) {
999- newOffsets = computeDistributedOffsetsForMatrixOp (
999+ newCoords = computeDistributedCoordinatesForMatrixOp (
10001000 rewriter, loc, layout, newWarpOp.getLaneid (), sgPayloadTy.getShape (),
10011001 currentOffsets);
10021002 }
10031003 xegpu::LoadMatrixOp newOp = xegpu::LoadMatrixOp::create (
10041004 rewriter, newWarpOp.getLoc (), *distPayloadByWarpOpOrFailure,
1005- newOperands[0 ], ValueRange (newOffsets ), newConstOffsetsAttr,
1005+ newOperands[0 ], ValueRange (newCoords ), newConstOffsetsAttr,
10061006 matrixOp.getSubgroupBlockIoAttr (), xegpu::DistributeLayoutAttr{});
10071007 // Resolve the output type and replace all uses.
10081008 rewriter.replaceAllUsesWith (
@@ -1045,7 +1045,7 @@ struct StoreMatrixDistribution final : public gpu::WarpDistributionPattern {
10451045 getDistVecTypeBasedOnLaneLayout (layout, sgPayloadTy);
10461046 if (failed (distPayloadByWarpOpOrFailure))
10471047 return rewriter.notifyMatchFailure (
1048- matrixOp, " The matrix op payload has no layout." );
1048+ matrixOp, " Failed to distribute matrix op payload based on layout." );
10491049
10501050 SmallVector<Value> operands = {matrixOp.getData (), matrixOp.getMemDesc ()};
10511051 const unsigned offsetsStartIdx = operands.size ();
@@ -1069,18 +1069,18 @@ struct StoreMatrixDistribution final : public gpu::WarpDistributionPattern {
10691069 ValueRange currentOffsets =
10701070 ValueRange (newOperands).drop_front (offsetsStartIdx);
10711071
1072- SmallVector<Value> newOffsets = currentOffsets;
1072+ SmallVector<Value> newCoords = currentOffsets;
10731073 rewriter.setInsertionPointAfter (newWarpOp);
10741074
10751075 if (!matrixOp.getSubgroupBlockIoAttr ()) {
1076- newOffsets = computeDistributedOffsetsForMatrixOp (
1076+ newCoords = computeDistributedCoordinatesForMatrixOp (
10771077 rewriter, loc, layout, newWarpOp.getLaneid (), sgPayloadTy.getShape (),
10781078 currentOffsets);
10791079 }
10801080
10811081 xegpu::StoreMatrixOp::create (
10821082 rewriter, loc, TypeRange{}, newOperands[0 ], newOperands[1 ],
1083- ValueRange (newOffsets ), newConstOffsetsAttr,
1083+ ValueRange (newCoords ), newConstOffsetsAttr,
10841084 matrixOp.getSubgroupBlockIoAttr (), xegpu::DistributeLayoutAttr{});
10851085 rewriter.eraseOp (matrixOp);
10861086 return success ();
0 commit comments