[Mlir-commits] [mlir] [mlir]Fix compose subview (PR #80551)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Feb 5 12:27:49 PST 2024


================
@@ -52,66 +52,81 @@ struct ComposeSubViewOpPattern : public OpRewritePattern<memref::SubViewOp> {
 
     // Offsets, sizes and strides OpFoldResult for the combined 'SubViewOp'.
     SmallVector<OpFoldResult> offsets, sizes, strides;
-
-    // Because we only support input strides of 1, the output stride is also
-    // always 1.
-    if (llvm::all_of(strides, [](OpFoldResult &valueOrAttr) {
-          Attribute attr = llvm::dyn_cast_if_present<Attribute>(valueOrAttr);
-          return attr && cast<IntegerAttr>(attr).getInt() == 1;
-        })) {
-      strides = SmallVector<OpFoldResult>(sourceOp.getMixedStrides().size(),
-                                          rewriter.getI64IntegerAttr(1));
-    } else {
-      return failure();
+    auto opStrides = op.getMixedStrides();
----------------
ftynse wrote:

Please expand `auto` unless the type is obvious from context, e.g., the right-hand side is a cast.

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


More information about the Mlir-commits mailing list