[Mlir-commits] [mlir] [mlir][vector] Allow integer indices in vector.extract/insert ops (PR #115808)

Matthias Springer llvmlistbot at llvm.org
Thu Jan 9 01:27:03 PST 2025


================
@@ -96,8 +96,10 @@ class OpWithOffsetSizesAndStridesConstantArgumentFolder final
 /// in `integers` is `kDynamic` or (2) the next value otherwise. If `valueTypes`
 /// is non-empty, it is expected to contain as many elements as `values`
 /// indicating their types. This allows idiomatic printing of mixed value and
-/// integer attributes in a list. E.g.
-/// `[%arg0 : index, 7, 42, %arg42 : i32]`.
+/// integer attributes in a list. E.g., `[%arg0 : index, 7, 42, %arg42 : i32]`.
+/// If `hasSameTypeDynamicValues` is `true`, `valueTypes` are expected to be the
+/// same and only one type is printed at the end of the list. E.g.,
+/// `[0, %arg2, 3, %arg42, 2 : i8]`.
----------------
matthias-springer wrote:

Clarify that the number of types in `valueTypes` must match the number of dynamic elements, even if `hasSameTypeDynamicValues` is set.

Btw, have you considered changing the API such that `valueTypes` contains only a single value in case of `hasSameTypeDynamicValues`? That would seem more natural to me.


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


More information about the Mlir-commits mailing list