[Mlir-commits] [mlir] Fix unsupported transpose ops for scalable vectors in LowerVectorTransfer (PR #86163)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Mar 22 04:23:14 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()) {
+      rewriter.eraseOp(newVec.getDefiningOp());
+      return failure();
----------------
banach-space wrote:

> and any changes rolled-back, I think), but it's erasing an operation.

It's erasing the Op to roll-back the changes :) And making sure that the new Op is not added to the list of Ops to be processed by the pattern rewriter driver.

> I think I've misunderstood this change. What's happening here? Did the test case previously lower with TransferWritePermutationLowering, and now TransferWriteNonPermutationLowering now manages to lower the same thing?

The test case used to trigger `TransferWritePermutationLowering`, but that's now disabled and looks like some other pattern is triggered. @cfRod , do you know which one?

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


More information about the Mlir-commits mailing list