[all-commits] [llvm/llvm-project] f82cf7: [mlir][tensor] Fix `getReassociationForCollapse` f...

Artem Gindinson via All-commits all-commits at lists.llvm.org
Fri Jun 13 11:03:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f82cf7442029d3376813db82eca60800e999bfb9
      https://github.com/llvm/llvm-project/commit/f82cf7442029d3376813db82eca60800e999bfb9
  Author: Artem Gindinson <gindinson at roofline.ai>
  Date:   2025-06-13 (Fri, 13 Jun 2025)

  Changed paths:
    M mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp
    M mlir/unittests/Dialect/Utils/ReshapeOpsUtilsTest.cpp

  Log Message:
  -----------
  [mlir][tensor] Fix `getReassociationForCollapse` for tensor/scalar re… (#144118)

…shapes

Commit 6e5a142 changed the behavior of the function when computing
reassociations between tensors (consisting of unit/dynamic dimensions)
and scalars/0d vectors. The IR representation for such reshapes actually
expects an empty reassociation, like so:
```
func.func @example(%arg0 : tensor<?x?x?xf32>) -> tensor<f32> {
  %0 = tensor.collapse_shape %arg0 [] : tensor<?x?x?xf32> into tensor<f32>
}
```

Restore the original behavior - the routine should resort to reporting
failures when compile time-known non-unit dimensions are part of the
attempted reassociation.

Signed-off-by: Artem Gindinson <gindinson at roofline.ai>



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