================
@@ -901,8 +903,8 @@ struct WgToSgLoadGatherOpWithOffset
       return failure();
     ArrayRef<int64_t> wgShape = resultType.getShape();
 
-    xegpu::DistributeLayoutAttr layout =
-        xegpu::getDistributeLayoutAttr(op.getResult());
+    xegpu::DistributeLayoutAttr layout = op.getLayoutAttr();
----------------
Jianhui-Li wrote:

Here it is fine to use getLayoutAttr() directly as these pattern works at the 
lower level knowing the operation type. 
If we use getAnchorLayout(), then we need to dynamic cast the op to 
AnchorLayoutInterface and then call the interface.   That is unnecessary step 
in this pattern.

getAnchorLayout() is used when the pass processes the IR without matching the 
specific operations, or some generic call back function where only a generic 
operation is available. 

https://github.com/llvm/llvm-project/pull/172125
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to