@@ -783,7 +783,8 @@ struct WgToSgLoadGatherOpWithOffset
783783 return failure ();
784784 ArrayRef<int64_t > wgShape = resultType.getShape ();
785785
786- xegpu::LayoutAttr layout = xegpu::getLayoutAttr (op.getResult ());
786+ xegpu::DistributeLayoutAttr layout =
787+ xegpu::getDistributeLayoutAttr (op.getResult ());
787788 if (!layout || !layout.isForWorkgroup ())
788789 return failure ();
789790
@@ -809,8 +810,8 @@ struct WgToSgLoadGatherOpWithOffset
809810 auto newLoadOp = rewriter.create <xegpu::LoadGatherOp>(
810811 loc, newTy, op.getSource (), offsets, mask, chunkSizeAttr,
811812 op.getL1HintAttr (), op.getL2HintAttr (), op.getL3HintAttr ());
812- xegpu::setLayoutAttr (newLoadOp->getResult (0 ),
813- layout.dropSgLayoutAndData ());
813+ xegpu::setDistributeLayoutAttr (newLoadOp->getResult (0 ),
814+ layout.dropSgLayoutAndData ());
814815 newLoadOps.push_back (newLoadOp);
815816 }
816817 rewriter.replaceOpWithMultiple (op, {newLoadOps});
@@ -835,7 +836,8 @@ struct WgToSgStoreScatterOpWithOffset
835836 if (!valueType)
836837 return failure ();
837838
838- xegpu::LayoutAttr layout = xegpu::getLayoutAttr (op.getValue ());
839+ xegpu::DistributeLayoutAttr layout =
840+ xegpu::getDistributeLayoutAttr (op.getValue ());
839841 if (!layout || !layout.isForWorkgroup ())
840842 return failure ();
841843
@@ -1057,7 +1059,7 @@ void XeGPUWgToSgDistributePass::runOnOperation() {
10571059
10581060 target.addDynamicallyLegalOp <xegpu::LoadGatherOp>(
10591061 [=](xegpu::LoadGatherOp op) -> bool {
1060- auto layout = xegpu::getLayoutAttr (op.getResult ());
1062+ auto layout = xegpu::getDistributeLayoutAttr (op.getResult ());
10611063 return isLegal (layout);
10621064 });
10631065
0 commit comments