[all-commits] [llvm/llvm-project] 311258: [mlir][tosa] Improve folder conformance to TOSA sp...

Luke Hutton via All-commits all-commits at lists.llvm.org
Thu Jun 4 01:37:23 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3112581e2945ed5027360387f0ddcb72115f3886
      https://github.com/llvm/llvm-project/commit/3112581e2945ed5027360387f0ddcb72115f3886
  Author: Luke Hutton <luke.hutton at arm.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
    M mlir/test/Dialect/Tosa/constant_folding.mlir

  Log Message:
  -----------
  [mlir][tosa] Improve folder conformance to TOSA specification (#200223)

This commit fixes some bugs in TOSA folders that cause non-conformant
results. The fixes include:
- tosa.intdiv - Folding when the lhs and rhs are zero. In the TOSA
specification this is undefined behaviour.
- tosa.div_ceil_shape/tosa.div_floor_shape - Folding when the lhs is
negative or the rhs is non-positive. In the TOSA specification this is
undefined behaviour.

In addition, some test cases have been added for non-exercised code
paths, including:
- tosa.intdiv - Rejects overflow cases
- tosa.greater/tosa.greater_equal/tosa.equal - Correctly evaluates NaN
cases to False.
- tosa.cast - Saturating rounding when input is out of range of the
output type.
- tosa.mod_shape - Rejects cases where lhs is negative or rhs is
non-positive.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list