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

Chao Chen llvmlistbot at llvm.org
Mon Jun 30 08:40:05 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:

> I mean now anyone with a tensor_desc can call this method. It not immediately clear from the API that it requires a scatter encoding. so anywhere you call this method you need to guard it by if `(tensorDesc.hasScattert())`, if not it as an unsafe call (assert will be removed in release build). So I don't see any direct benefit of exposing this to tensorDesc.

Ah, I got your point. I think we can guard it in the interface. 

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


More information about the Mlir-commits mailing list