Skip to content
Commit cfdea8f5 authored by rikhuijzer's avatar rikhuijzer Committed by Jacques Pienaar
Browse files

[MLIR][Tosa] Fix fp canonicalization for `clamp`

The canonicalization for `clamp` removed the `clamp` operation when the
chosen min and max values were outside the range of what is possible to
represent with the input type. For example, if the input type is `i8`,
then the min and max values must be between -128 and 127. If the min and
max are, say, -200 and 200, then the `clamp` operation can be safely
removed.

However, as pointed out by @wyanzhao, this is wrong for floating point
types since they can represent infinity.

Fixes #62341.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D152123
parent 77302696
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment