[Mlir-commits] [mlir] Fix unsupported transpose ops for scalable vectors in LowerVectorTransfer (PR #86163)
Benjamin Maxwell
llvmlistbot at llvm.org
Fri Mar 22 02:49:16 PDT 2024
================
@@ -201,12 +205,19 @@ struct TransferWritePermutationLowering
// Generate new transfer_write operation.
Value newVec = rewriter.create<vector::TransposeOp>(
op.getLoc(), op.getVector(), indices);
+
+ auto vectorType = cast<VectorType>(newVec.getType());
+
+ if (vectorType.isScalable() && !*vectorType.getScalableDims().end()) {
----------------
MacDue wrote:
I believe `*vectorType.getScalableDims().end()` is could be an out-of-bounds access. The `.end()` method returns an iterator passed the end of the array, I think what you probably want is:
```suggestion
if (vectorType.isScalable() && !vectorType.getScalableDims().back()) {
```
https://github.com/llvm/llvm-project/pull/86163
More information about the Mlir-commits
mailing list