[all-commits] [llvm/llvm-project] d7c606: Fix bufferization of collapse_shape of subviews wi...

Johannes Reifferscheid via All-commits all-commits at lists.llvm.org
Fri Sep 16 02:32:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7c606f5b7f4ebdc2292508ecd5eae7db83c39cc
      https://github.com/llvm/llvm-project/commit/d7c606f5b7f4ebdc2292508ecd5eae7db83c39cc
  Author: Johannes Reifferscheid <jreiffers at google.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/test/Dialect/Tensor/bufferize.mlir

  Log Message:
  -----------
  Fix bufferization of collapse_shape of subviews with size 1 dims.

Currently, there's an optimization that claims dimensions of size 1 are always
contiguous. This is not necessarily the case for subviews.

```
Input:

[
  [
    [0, 1],
    [2, 3]
  ],
  [
    [4, 5]
    [6, 7]
  ]
]

Subview:

  [
    [
      [0, 1],
    ],
    [
      [4, 5]
    ]
  ]
```

The old logic treats this subview as contiguous, when it is not.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D134026




More information about the All-commits mailing list