[Mlir-commits] [mlir] [MLIR][XeGPU] Allow create mem desc from 2d memref (PR #167767)

Sang Ik Lee llvmlistbot at llvm.org
Mon Nov 17 10:47:16 PST 2025


================
@@ -1304,11 +1304,11 @@ def XeGPU_CreateMemDescOp: XeGPU_Op<"create_mem_desc", [Pure,
     as the underlying shared local memory.
 
     Arguments:
-     - `source` : a 1D statically shaped memref with element type i8, representing the raw SLM buffer.
+     - `source` : 1D or 2D statically shape memref, representing the raw SLM buffer. When the source is provided as 1D memref, its type must be i8. 
     Results:
      - `mem_desc` : the memory descriptor.
   }];
-  let arguments = (ins StaticShared1DMemRefOf<[I8]>:$source);
+  let arguments = (ins AnyTypeOf<[StaticShared1DMemRefOf<[I8]>, ConfinedType<MemRefRankOf<[XeGPU_ScalarType], [2]>, [HasStaticShapePred, isSharedPred]>]>:$source);
----------------
silee2 wrote:

StaticShared1DMemrefOf is defined in the same file as
```
class StaticShared1DMemRefOf<list<Type> allowedTypes> :
  ConfinedType<MemRefRankOf<allowedTypes, [1]>, [HasStaticShapePred, isSharedPred]>
```
Which is very similar to 
```
ConfinedType<MemRefRankOf<[XeGPU_ScalarType], [2]>, [HasStaticShapePred, isSharedPred]>
```
Can you add a class `StaticShared2DMemRefOf` to make it more consistent?

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


More information about the Mlir-commits mailing list