[Mlir-commits] [mlir] [mlir][tosa] Fail lowering of `tosa.pad` -> `tensor.pad` with -1 padding (PR #232221)
Mehdi Amini
llvmlistbot at llvm.org
Thu Oct 15 03:24:27 PDT 2026
joker-eph wrote:
Actually this is checked with ERROR_IF in the TOSA spec, and this operator means that an implementation **must** diagnose the error. It's not undefined behavior.
```
The REQUIRE function defines the conditions required by the TOSA operator. If the conditions are not met then the result of the TOSA graph is marked as unpredictable. Once the graph_result is set to tosa_unpredictable, the whole graph is considered unpredictable.
The ERROR_IF function defines a condition that must set an error if the condition holds and the graph is not unpredictable. Note that if a graph contains both unpredictable and error statements then result of tosa_execute_graph() is tosa_unpredictable. This condition is captured in the ERROR_IF function.
```
I wish they would have used `REQUIRE` here...
The correct lowering for this padding involves a runtime check with an assertion or something like that.
https://github.com/llvm/llvm-project/pull/232221
More information about the Mlir-commits
mailing list