[all-commits] [llvm/llvm-project] df455b: [mlir][MemRef] Fix the simplification of extract_s...

qcolombet via All-commits all-commits at lists.llvm.org
Tue Oct 18 12:38:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df455beedfcd4634450e5782d6bb4986218174e2
      https://github.com/llvm/llvm-project/commit/df455beedfcd4634450e5782d6bb4986218174e2
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2022-10-18 (Tue, 18 Oct 2022)

  Changed paths:
    M mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
    M mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir

  Log Message:
  -----------
  [mlir][MemRef] Fix the simplification of extract_strided_metadata(subview)

Prior to this patch we were wrongly applying the sub-strides to the
computation of the final offset of the subview.

Put differently, we were computing the offset as:
```
offset = baseOffset + sum(subOffset#i * baseStrides#i * subSizes#i)
```
Whereas we should be doing:
```
offset = baseOffset + sum(subOffset#i * baseStrides#i)
```
I.e., drop the subSizes#i term from the sum.

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




More information about the All-commits mailing list