[Mlir-commits] [mlir] [mlir][tosa] Fail lowering of `tosa.pad` -> `tensor.pad` with -1 padding (PR #232221)

Luke Hutton llvmlistbot at llvm.org
Thu Oct 15 05:14:04 PDT 2026


lhutton1 wrote:

As @joker-eph mentioned, negative padding is not supported in TOSA as per the spec. In general, the TOSA dialect may be extended beyond what the specification permits with the `tosa-validate` pass being used to check conformance against the specification. 

IIRC the non-negative `tosa.pad` verifier checks didn't always exist and when it came to adding them, it broke some tests e.g. https://github.com/llvm/llvm-project/blob/b9da7a34df933ffbb0fdd8ef24300143b70ed2b5/mlir/test/Conversion/TosaToTensor/tosa-to-tensor.mlir#L555, leading us to believe there was a use-case. I would support disallowing -1 in the `tosa.pad` verifier.

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


More information about the Mlir-commits mailing list