[Mlir-commits] [mlir] [mlir][tosa] Emit a runtime assertion when lowering `tosa.pad` with negative padding (PR #232221)
Federico Bruzzone
llvmlistbot at llvm.org
Sat Oct 17 02:23:05 PDT 2026
================
----------------
FedericoBruzzone wrote:
I see your point. However, looking at the _new_ ODS docs, it says:
> The padding amounts must be non-negative. A negative padding is not valid
for execution. For a constant padding, the **verifier accepts** -1 as a
placeholder for an amount that is not known at compile time, in which case
the corresponding output dimension is dynamic.
Which is true, right? And then, right after:
> The TOSA specification **requires a negative padding to be diagnosed**
(`ERROR_IF`). The `tosa-validate` pass reports it, and the lowering to the
Tensor dialect emits a runtime assertion. It is recommended to run
`tosa-validate` before lowering.
But please, if you think we should explicitly obscure the `-1` fact from the docs, I'm more than happy to remove it.
I just want to remark on this, since I want to be sure we're on the same page, @joker-eph.
https://github.com/llvm/llvm-project/pull/232221
More information about the Mlir-commits
mailing list