[Mlir-commits] [mlir] [mlir][vector] Bugfix of linearize `vector.extract` (PR #106836)
Cullen Rhodes
llvmlistbot at llvm.org
Wed Sep 4 00:36:05 PDT 2024
================
@@ -337,6 +337,9 @@ struct LinearizeVectorExtract final
matchAndRewrite(vector::ExtractOp extractOp, OpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const override {
Type dstTy = getTypeConverter()->convertType(extractOp.getType());
----------------
c-rhodes wrote:
I figured it out, the type converter it's using has a single conversion for VectorType at https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp#L464-L470
I disregarded that as I couldnt see the connection to `populateVectorLinearizeShuffleLikeOpsPatterns` until I saw https://github.com/llvm/llvm-project/blob/main/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp#L867-L868
I guess `convertType` wraps that to return null type if it's unchanged. I think in my head I was thinking of LLVM type converter (which also flattens n-D vectors to 1-D), but of course that's not relevant here.
So yes, it's safe to assume this conversion failing indicates type isn't an n-D vector type :)
https://github.com/llvm/llvm-project/pull/106836
More information about the Mlir-commits
mailing list