[llvm] [mlir] [MLIR] Generalize expand_shape to take shape as explicit input (PR #69267)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 16:36:54 PDT 2024


================
@@ -586,9 +586,18 @@ struct FoldFillWithTensorReshape : OpRewritePattern<TensorReshapeOp> {
       return failure();
 
     Location loc = oldFill.getLoc();
-    auto newInit = rewriter.create<TensorReshapeOp>(
-        loc, reshapeOp.getResultType(), oldFill.output(),
-        reshapeOp.getReassociation());
+    TensorReshapeOp newInit;
+    if constexpr (std::is_same<TensorReshapeOp, tensor::ExpandShapeOp>::value) {
+
----------------
MaheshRavishankar wrote:

nit: unnecessary empty line

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


More information about the llvm-commits mailing list