[Mlir-commits] [mlir] [mlir][Tosa] fix fp16/bf16 support for Clamp min/max attributes (PR #69192)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 19 08:52:07 PDT 2023


fabrizio-indirli wrote:

@GeorgeARM @eric-k256 
I updated the patch so that _min_fp_ & _max_fp_ are a generic Float attribute (defined as `Tosa_FloatAttr` in _TosaTypesBase.td_ ) and added a verifier to check that the types are aligned.
In particular, it checks that:
- Input and output datatype are the same
- If datatype is float, checks that the min_fp type == max_fp type, and that this attributes' type is the same of the input/output datatype OR has an higher bitwidth.
  Supporting this last case (min/max_fp with an higher precision than the input/output float type) should allow to retain the interface unchanged and to [pass existing tests that had "f32" attributes and "f16"/"bf16" input/output datatype](https://github.com/llvm/llvm-project/blob/21e1b13f3384b875bd2205a736570320cb020f3e/mlir/test/Dialect/Tosa/canonicalize.mlir#L50C5-L50C5)

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


More information about the Mlir-commits mailing list