Index: mlir/include/mlir/Dialect/Vector/VectorOps.h =================================================================== --- mlir/include/mlir/Dialect/Vector/VectorOps.h +++ mlir/include/mlir/Dialect/Vector/VectorOps.h @@ -124,6 +124,8 @@ /// Lower 2-D transpose to `vector.flat_transpose`, maps 1-1 to LLVM matrix /// intrinsics. Flat = 1, + /// Do not lower transpose. + None = 2, }; /// Enum to control the splitting of `vector.transfer` operations into /// in-bounds and out-of-bounds variants. Index: mlir/lib/Dialect/Vector/VectorTransforms.cpp =================================================================== --- mlir/lib/Dialect/Vector/VectorTransforms.cpp +++ mlir/lib/Dialect/Vector/VectorTransforms.cpp @@ -1300,6 +1300,9 @@ LogicalResult matchAndRewrite(vector::TransposeOp op, PatternRewriter &rewriter) const override { + if (vectorTransformsOptions.vectorTransposeLowering == + vector::VectorTransposeLowering::None) + return failure(); auto loc = op.getLoc(); VectorType resType = op.getResultType();