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

Ramiro Leal-Cavazos llvmlistbot at llvm.org
Thu Oct 26 11:59:52 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>
----------------
ramiro050 wrote:

>From Sanjoy's comment in link above:

> Unless I'm missing some C++ trick, that requires to add a dependency from this header to either the memref or the tensor dialect. I assumed that was not OK, but please let me know if it is.

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


More information about the Mlir-commits mailing list