[Mlir-commits] [mlir] [mlir][vector] Improve shape_cast lowering (PR #140800)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue May 27 09:50:52 PDT 2025


================
@@ -28,17 +28,20 @@ using namespace mlir;
 using namespace mlir::vector;
 
 /// Increments n-D `indices` by `step` starting from the innermost dimension.
-static void incIdx(SmallVectorImpl<int64_t> &indices, VectorType vecType,
+static void incIdx(MutableArrayRef<int64_t> indices, ArrayRef<int64_t> shape,
----------------
banach-space wrote:

Perhaps just a slow day for me, but it took me a while to follow the logic in this method. Let me share my observations:
* `step` only really defines the step for the trailing dim? If yes, it would be good to update the variable name.
* `spill` is either `0` or `1`.

is this correct?

Btw, extra documentation would help. My initial interpretation was: "Update every single index by 1", but that's not true, is it?

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


More information about the Mlir-commits mailing list