[all-commits] [llvm/llvm-project] 7e35a9: [mlir] Replace dynamic sizes in insert_slice of te...

Max191 via All-commits all-commits at lists.llvm.org
Wed May 8 12:06:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e35a9a0e77aad673a3054855761ee4afd2605c1
      https://github.com/llvm/llvm-project/commit/7e35a9a0e77aad673a3054855761ee4afd2605c1
  Author: Max191 <44243577+Max191 at users.noreply.github.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

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

  Log Message:
  -----------
  [mlir] Replace dynamic sizes in insert_slice of tensor.cast canonicalization (#91352)

In some cases this pattern may ignore static information due to dynamic
operands in the insert_slice sizes operands, e.g.:
```
%0 = tensor.cast %arg0 : tensor<1x?xf32> to tensor<?x?xf32>
%1 = tensor.insert_slice %0 into %arg1[...] [%s0, %s1] [...] 
    : tensor<?x?xf32> into tensor<?x?xf32>
```
Can be rewritten into:
```
%1 = tensor.insert_slice %arg0 into %arg1[...] [1, %s1] [...] 
    : tensor<1x?xf32> into tensor<?x?xf32>
```
This PR updates the matching in the pattern to allow rewrites like this.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list