[Mlir-commits] [mlir] Relax checks on vector.shape_cast (PR #136587)
James Newling
llvmlistbot at llvm.org
Tue Apr 22 16:42:37 PDT 2025
================
@@ -2244,18 +2244,8 @@ def Vector_ShapeCastOp :
Results<(outs AnyVectorOfAnyRank:$result)> {
let summary = "shape_cast casts between vector shapes";
let description = [{
- The shape_cast operation casts between an n-D source vector shape and
- a k-D result vector shape (the element type remains the same).
-
- If reducing rank (n > k), result dimension sizes must be a product
- of contiguous source dimension sizes.
- If expanding rank (n < k), source dimensions must factor into a
- contiguous sequence of destination dimension sizes.
- Each source dim is expanded (or contiguous sequence of source dims combined)
- in source dimension list order (i.e. 0 <= i < n), to produce a contiguous
- sequence of result dims (or a single result dim), in result dimension list
- order (i.e. 0 <= j < k). The product of all source dimension sizes and all
- result dimension sizes must match.
+ The shape_cast operation casts from a source vector to a target vector,
+ retaining the element type and number of elements.
----------------
newling wrote:
I realized this was already in the verifier, so logic unchanged w.r.t. scalable dims. Added a comment in the .td.
https://github.com/llvm/llvm-project/pull/136587
More information about the Mlir-commits
mailing list