[all-commits] [llvm/llvm-project] 0ebb05: [MLIR] [TOSA]: Move reshape(reshape(x)) -> reshape...

Matthias Gehre via All-commits all-commits at lists.llvm.org
Mon Jul 17 01:14:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ebb0503113e97eb14dc679f06bdc1d2e7296d54
      https://github.com/llvm/llvm-project/commit/0ebb0503113e97eb14dc679f06bdc1d2e7296d54
  Author: Matthias Gehre <matthias.gehre at xilinx.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
    M mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
    M mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp

  Log Message:
  -----------
  [MLIR] [TOSA]: Move reshape(reshape(x)) -> reshape(x) from canonicalization to fold

reshape(reshape(x)) -> reshape(x) can be directly written as a fold instead of a canonicalization,
to help other passes cleanup while they work.

This initially broke ReshapeConverterExpand/Collapse, which relies on creating foldable reshapes and a carefully crafted
benefit priority of patterns.
I turned this into a single pattern on reshapes, which does expand and/or collapse as needed in one go.

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




More information about the All-commits mailing list