[Mlir-commits] [mlir] [MLIR][XeGPU] setUnitDim bug fix and add documentation (PR #173521)

Charitha Saumya llvmlistbot at llvm.org
Thu Jan 15 08:03:23 PST 2026


================
@@ -604,55 +604,60 @@ bool SliceAttr::isEqualTo(const xegpu::DistributeLayoutAttr &other) {
 }
 
 // Helper function to adjust unit dimensions from sliced space to parent space
+// say we have a parent shape of rank 4, and slice dims [1,3], so the sliced
+// shape is of rank 2, if we want to set unit dim [0] in sliced space, it maps to
+// dim [0] in parent space; if we want to set unit dim [1] in sliced space, it maps to
+// dim [2] in parent space.
 static SetVector<int64_t>
 adjustUnitDimsWithSliceDims(const SetVector<int64_t> &unitDims,
----------------
charithaintc wrote:

seems like this function has nothing to do with `unitDims`. It just maps a give set of `dims` into the parent's dims. Consider renaming `unitDims` to `dimsToMap` or something. 

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


More information about the Mlir-commits mailing list