[Mlir-commits] [mlir] [mlir][tosa] Check for 0-ranked-tensors during fold (PR #68512)

Georgios Pinitas llvmlistbot at llvm.org
Tue Oct 10 19:20:49 PDT 2023


================
@@ -591,3 +591,13 @@ func.func @fold_abs_abs(%arg0: tensor<?x1xf32>) -> tensor<?x1xf32> {
   %1 = tosa.abs %0 : (tensor<?x1xf32>) -> tensor<?x1xf32>
   return %1 : tensor<?x1xf32>
 }
+
+// -----
+
+// CHECK-LABEL: @rank_zero
+func.func nested @rank_zero() {
+  %0 = tensor.empty() : tensor<i32>
+  %1 = tosa.reduce_min %0 {axis = 0 : i32} : (tensor<i32>) -> tensor<1x10xi32>
----------------
GeorgeARM wrote:

Also worth adding a `CHECK-NOT` label and ensure that the `reduce_min` and `reverse` ops are not present after the canonicalization

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


More information about the Mlir-commits mailing list