[Mlir-commits] [mlir] [mlir][tosa] Fix pad op verifier when padding is dynamic (PR #177622)
Luke Hutton
llvmlistbot at llvm.org
Wed Jan 28 10:43:48 PST 2026
================
@@ -686,6 +686,16 @@ func.func @test_pad_explicit_value(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3
return %1 : tensor<13x21x3xf32>
}
+// -----
+// CHECK-LABEL: test_pad_dynamic_padding
+func.func @test_pad_dynamic_padding(%arg0: tensor<1x?x?x576xf32>) -> tensor<1x?x?x576xf32> {
+ %0 = tosa.const_shape {values = dense<0> : tensor<1xindex>} : () -> !tosa.shape<1>
+ %1 = tosa.concat_shape %0, %0, %0, %0, %0, %0, %0, %0 : (!tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>, !tosa.shape<1>) -> !tosa.shape<8>
+ %2 = "tosa.const"() <{values = dense<0.000000e+00> : tensor<1xf32>}> : () -> tensor<1xf32>
+ %3 = tosa.pad %arg0, %1, %2 : (tensor<1x?x?x576xf32>, !tosa.shape<8>, tensor<1xf32>) -> tensor<1x?x?x576xf32>
----------------
lhutton1 wrote:
That's correct, currently the TOSA graph is expected to be resolved to static prior to lowering. I suspect this will involve creating a lowering from TOSA shape ops to the shape dialect, though I'm not aware of any immediate plans to support this.
https://github.com/llvm/llvm-project/pull/177622
More information about the Mlir-commits
mailing list