[Mlir-commits] [mlir] [DRAFT] Generalize expand_shape to take shape as explicit input (PR #69267)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Oct 17 14:42:45 PDT 2023


================
@@ -197,8 +197,21 @@ class ReshapeConverterExpand : public OpConversionPattern<tosa::ReshapeOp> {
       return rewriter.notifyMatchFailure(
           reshape, "tosa.reshape Cannot expand into given shape");
     }
+
+    Value input = adaptor.getInput1();
+    SmallVector<OpFoldResult> inputShape =
+        tensor::getMixedSizes(rewriter, reshape.getLoc(), input);
+    SmallVector<OpFoldResult> outputShape;
+    if (failed(tensor::ExpandShapeOp::inferOutputShape(
----------------
MaheshRavishankar wrote:

We could just use a helper build method to do this automatically instead of adding it at every call site.

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


More information about the Mlir-commits mailing list