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

Hocky Yudhiono llvmlistbot at llvm.org
Tue Mar 24 20:10:35 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>
----------------
hockyy wrote:

Oh yes, I overlooked. It requires some non unit dimensions getting swapped

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


More information about the Mlir-commits mailing list