[Mlir-commits] [mlir] [mlir][xegpu] Add definition of SliceAttr (PR #150146)

Charitha Saumya llvmlistbot at llvm.org
Tue Aug 5 12:59:28 PDT 2025


================
@@ -41,6 +41,18 @@ def XeGPU_Dialect : Dialect {
       /// Checks if the given shape can be evenly distributed based on the layout
       /// and data factors provided by the LayoutAttr.
       static bool isEvenlyDistributable(llvm::ArrayRef<int64_t> shape, xegpu::LayoutAttr attr);
+
+      /// drops/slices the shape in the specified dims, and return the rest. e.g.,
+      /// for shape = [32, 64, 8], dims = [0, 2], it will return [64]
+      template<typename T, typename U>
+      static llvm::SmallVector<T> slice(llvm::ArrayRef<T> shape, llvm::ArrayRef<U> dims) {
----------------
charithaintc wrote:

seems like this unrelated to XeGPUDialect. any reason for placing here? can it be moved to Utils?

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


More information about the Mlir-commits mailing list