Skip to content

Conversation

@AndreyPavlenko
Copy link

If the new shape has a different number of dims, VectorType::verify() fail with error: 'number of dims must match'.

If the new shape has a different number of dims, VectorType::verify
fai with error: 'number of dims must match'.
@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Dec 19, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 19, 2025

@llvm/pr-subscribers-mlir-core

@llvm/pr-subscribers-mlir

Author: Andrey Pavlenko (AndreyPavlenko)

Changes

If the new shape has a different number of dims, VectorType::verify() fail with error: 'number of dims must match'.


Full diff: https://github.com/llvm/llvm-project/pull/173007.diff

1 Files Affected:

  • (modified) mlir/lib/IR/BuiltinTypes.cpp (+4-2)
diff --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp
index ce47c60c9b932..280ab437c1bd5 100644
--- a/mlir/lib/IR/BuiltinTypes.cpp
+++ b/mlir/lib/IR/BuiltinTypes.cpp
@@ -285,8 +285,10 @@ VectorType VectorType::scaleElementBitwidth(unsigned scale) {
 
 VectorType VectorType::cloneWith(std::optional<ArrayRef<int64_t>> shape,
                                  Type elementType) const {
-  return VectorType::get(shape.value_or(getShape()), elementType,
-                         getScalableDims());
+  auto shapeVal = shape.value_or(getShape());
+  SmallVector<bool> scalableDims(getScalableDims());
+  scalableDims.resize(shapeVal.size(), false);
+  return VectorType::get(shapeVal, elementType, scalableDims);
 }
 
 //===----------------------------------------------------------------------===//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mlir:core MLIR Core Infrastructure mlir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants