[Mlir-commits] [mlir] [mlir][vector] Add a check to ensure input vector rank equals target shape rank (PR #127706)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Wed Feb 19 03:09:04 PST 2025
================
@@ -437,6 +437,8 @@ struct UnrollElementwisePattern : public RewritePattern {
auto dstVecType = cast<VectorType>(op->getResult(0).getType());
SmallVector<int64_t> originalSize =
*cast<VectorUnrollOpInterface>(op).getShapeForUnroll();
+ if (originalSize.size() != targetShape->size())
----------------
banach-space wrote:
```suggestion
// Bail-out if rank(source) != rank(target). The main limitation here is the fact that `ExtractStridedSlice` requires the rank for the input and output to match. If needed, we can relax this later.
if (originalSize.size() != targetShape->size())
```
https://github.com/llvm/llvm-project/pull/127706
More information about the Mlir-commits
mailing list