[Mlir-commits] [mlir] [mlir][xegpu] Relax rank restriction of TensorDescType (PR #145916)

Chao Chen llvmlistbot at llvm.org
Mon Jun 30 08:40:14 PDT 2025


================
@@ -303,9 +303,7 @@ void XeGPUBlockingPass::runOnOperation() {
       // If the encoding is a ScatterTensorDescAttr, we need to
       // potentially adjust the chunk size based on the inst_data.
       if (tdescTy.isScattered()) {
-        auto scatterAttr =
-            llvm::dyn_cast_if_present<xegpu::ScatterTensorDescAttr>(encoding);
-        int64_t chunkSize = scatterAttr.getChunkSize().getInt();
+        int64_t chunkSize = tdescTy.getChunkSize();
----------------
chencha3 wrote:

> My 2 cents is that either approach seems reasonable, it's all about convenience, least surprise, and most importantly clearly documenting API's behavior. So on that note, could you add small doc string to the definition in tablegen?
> 
> Related to that, now we have two variants of `getChunkSize` that return either `IntegerAttr` or `int`. I'd suggest also refactoring this one to `getChunkSizeAsInt` for consistency.

Sure, will fix it. 

https://github.com/llvm/llvm-project/pull/145916


More information about the Mlir-commits mailing list