[all-commits] [llvm/llvm-project] 9e8e47: [mlir][vector] Fix double rank reducing folding bug

Lei Zhang via All-commits all-commits at lists.llvm.org
Fri Sep 30 13:51:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e8e4779a2627de41a17766acc310f131673750b
      https://github.com/llvm/llvm-project/commit/9e8e4779a2627de41a17766acc310f131673750b
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2022-09-30 (Fri, 30 Sep 2022)

  Changed paths:
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/test/Dialect/Vector/canonicalize.mlir

  Log Message:
  -----------
  [mlir][vector] Fix double rank reducing folding bug

In https://reviews.llvm.org/D133883, we changed the
`FoldExtractSliceIntoTransferRead` pattern from requiring
full identity map to minor identity map. This effectively
allows rank reducing `vector.transfer_read` ops. However,
the logic for checking `tensor.extract_slice` rank reducing
still looks at the vector rank, which now could be smaller
than the `tensor.extract_slice`'s output tensor rank.
It ends up we can have incorrect index cacluation after
folding due to this double rank reducing behavior.

Reviewed By: ThomasRaoux

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




More information about the All-commits mailing list