[Mlir-commits] [mlir] [MLIR][Tosa] Fix crash in TransposeOp::fold for unranked result type (PR #188996)

Mehdi Amini llvmlistbot at llvm.org
Fri Mar 27 06:34:57 PDT 2026


https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/188996

The identity-transpose folder returned getInput1() directly when the permutation is the identity (0, 1, ..., N-1). However, the input and result types may differ — for example the result may be unranked (tensor<*xi32>) while the input is ranked (tensor<3x2xi32>). Returning a value of the wrong type triggers the "incorrect fold result type" assertion.

Fix: bail out of folding when the input type does not match the result type. The transpose_is_reshape canonicalization pattern handles the case where the permutation is an identity but types differ.

Fixes #187974

Assisted-by: Claude Code

The server is unavailable at this time. Please wait a few minutes before you try again.


More information about the Mlir-commits mailing list