[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
================
@@ -167,9 +190,11 @@ static LogicalResult verifyReshapeLikeShapes(OpTy op, ShapedType collapsedType,
/// Returns true iff the type is a MemRefType and has a non-identity layout.
bool hasNonIdentityLayout(Type type);
+enum class ReshapeOpKind { kExpand, kCollapse };
+
/// Pattern to collapse producer/consumer reshape ops that are both collapsing
/// dimensions or are both expanding dimensions.
-template <typename ReshapeOpTy>
+template <typename ReshapeOpTy, ReshapeOpKind opKind>
----------------
MaheshRavishankar wrote:
Not sure why we need an extra template parameter here... We should be able to get this from the `ReshapeOpTy` itself.
https://github.com/llvm/llvm-project/pull/69267
More information about the Mlir-commits
mailing list