[Mlir-commits] [mlir] [mlir][tosa] Fix unranked tosa canonicalizations crashes (PR #188188)

Sayan Saha llvmlistbot at llvm.org
Tue Mar 24 05:39:14 PDT 2026


================
@@ -46,6 +46,26 @@ func.func @transpose_nofold_shape(%arg0: tensor<3x4xf32>) -> tensor<?x?xf32> {
 
 // -----
 
+// CHECK-LABEL: @transpose_nofold_unranked_result
+func.func @transpose_nofold_unranked_result() -> tensor<*xf32> {
+  %input = "tosa.const"() {values = dense<1.0> : tensor<1xf32>} : () -> tensor<1xf32>
+  // CHECK: tosa.reshape
+  %1 = tosa.transpose %input { perms = array<i32: 0> }: (tensor<1xf32>) -> tensor<*xf32>
----------------
sahas3 wrote:

Can the test use a different perms input so that the transpose is not canonicalized to reshape, otherwise the test is a bit confusing.

https://github.com/llvm/llvm-project/pull/188188


More information about the Mlir-commits mailing list