[Mlir-commits] [mlir] [mlir][vector][NFC] Document vector contract reshape helpers (PR #200544)

Diego Caballero llvmlistbot at llvm.org
Tue Jun 2 15:56:05 PDT 2026


================
@@ -71,8 +71,23 @@ static AffineMap adjustMap(AffineMap map, int64_t index,
   return AffineMap::get(map.getNumDims() - 1, 0, results, ctx);
 }
 
-// Helper method to possibly drop a dimension in a load.
-// TODO
+/// Returns a value of the same element type as `val`, but with the dimension
+/// at position `index` dropped, by selecting the slab at coordinate `pos`
+/// along that dimension. `val` must have type `type`.
+///
+/// The `index == -1` case is treated as a pass-through: `val` is returned
+/// unchanged. This supports contract operands whose indexing map does not
+/// reference the iterator currently being unrolled (e.g. a broadcast operand
+/// or a unit-size reduction dim that only appears on one side).
+///
+/// For `index == 0` the result is a single `vector.extract %val[pos]`. For
+/// `index > 0` the function recursively unrolls the leading dimension and
+/// drops dimension `index - 1` from each unrolled sub-slab, then reassembles
----------------
dcaballe wrote:

I'm not sure "slab" is used in general. Maybe sub-vector?

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


More information about the Mlir-commits mailing list