[all-commits] [llvm/llvm-project] 475989: [mlir][tensor] Fix bug in insert_slice canonical. ...

Alexey Z. via All-commits all-commits at lists.llvm.org
Thu Feb 8 17:22:39 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4759890f859277cd798648a9a333573cd088d98a
      https://github.com/llvm/llvm-project/commit/4759890f859277cd798648a9a333573cd088d98a
  Author: Alexey Z <alexey.zhikhar at gmail.com>
  Date:   2024-02-08 (Thu, 08 Feb 2024)

  Changed paths:
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
    M mlir/test/Dialect/Tensor/canonicalize.mlir

  Log Message:
  -----------
  [mlir][tensor] Fix bug in insert_slice canonical. with tensor encoding (#81045)

Previously, `InsertSliceOpSourceCastInserter` was incorrectly applied to
a case when tensor types have an encoding attribute attached to them.
The type `newSrcType` was missing that attribute from the old `srcType`,
which made the expression `srcType == newSrcType` false, since
`tensor<2x2xf32, "foo">` is not equal to `tensor<2x2xf32>`. That lead to
an endless back and forth between `InsertSliceOpSourceCastInserter` that
would introduce a cast and `InsertSliceOpCastFolder` that would remove
it right after.




More information about the All-commits mailing list