File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
lib/Dialect/XeGPU/Transforms Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -302,9 +302,9 @@ void XeGPUBlockingPass::runOnOperation() {
302302 Attribute encoding = tdescTy.getEncoding ();
303303 // If the encoding is a ScatterTensorDescAttr, we need to
304304 // potentially adjust the chunk size based on the inst_data.
305- if (encoding && mlir::isa<xegpu::ScatterTensorDescAttr>(encoding )) {
306- auto scatterAttr =
307- mlir::dyn_cast<xegpu::ScatterTensorDescAttr>(encoding);
305+ if (tdescTy. isScattered ( )) {
306+ auto scatterAttr = tdescTy. getEncodingAsScatterTensorDescAttr ();
307+ // mlir::dyn_cast<xegpu::ScatterTensorDescAttr>(encoding);
308308 int64_t chunkSize = scatterAttr.getChunkSize ().getInt ();
309309
310310 if (chunkSize > 1 ) {
Original file line number Diff line number Diff line change @@ -102,14 +102,12 @@ struct TestXeGPUUnrollingPatterns
102102 // attribute
103103 if (auto tdescTy = dyn_cast<xegpu::TensorDescType>(type)) {
104104 Attribute encoding = tdescTy.getEncoding ();
105- auto layout = llvm::dyn_cast_if_present<xegpu::LayoutAttr>(
106- tdescTy.getLayout ());
105+ auto layout = tdescTy.getLayoutAttr ();
107106
108107 // If the encoding is a ScatterTensorDescAttr, we need to
109108 // potentially adjust the chunk size based on the inst_data.
110- if (encoding && mlir::isa<xegpu::ScatterTensorDescAttr>(encoding)) {
111- auto scatterAttr =
112- mlir::dyn_cast<xegpu::ScatterTensorDescAttr>(encoding);
109+ if (tdescTy.isScattered ()) {
110+ auto scatterAttr = tdescTy.getEncodingAsScatterTensorDescAttr ();
113111 int64_t chunkSize = scatterAttr.getChunkSize ().getInt ();
114112
115113 if (chunkSize > 1 ) {
You can’t perform that action at this time.
0 commit comments