[mlir][tosa] Prefer tosa.transpose composition canonicalization to reshape
authorRob Suderman <suderman@google.com>
Wed, 18 Jan 2023 16:59:02 +0000 (08:59 -0800)
committerRob Suderman <suderman@google.com>
Wed, 18 Jan 2023 16:59:24 +0000 (08:59 -0800)
commit198d1d99769700d0136ac90275a8d6fa1871accf
tree3026cd29e9f50dcca8f6a34ee6b581d319d5888c
parent4cec5eadfd1f5ed7f7037e0c7e6b5fcd59045125
[mlir][tosa] Prefer tosa.transpose composition canonicalization to reshape

It is preferred to merge tosa.transpose operations together rather than convert
one to a tosa.reshape. This is to leverage the tosa.transpose -> tosa.transpose
merging canonicalization.

Reviewed By: AviadCo

Differential Revision: https://reviews.llvm.org/D141434
mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
mlir/test/Dialect/Tosa/transpose-fold.mlir [moved from mlir/test/IR/transpose-fold.mlir with 70% similarity]