On Thu, Jul 21, 2022 at 05:28:34PM -0400, Sam Feifer via Gcc-patches wrote:
> This patch is intended to fix a missed optimization in match.pd. It optimizes
> (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). Additionally, the
> pattern (x <= 0 ? -x : 0) now gets optimized to max(-x, 0), which
This patch is intended to fix a missed optimization in match.pd. It optimizes
(x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). Additionally, the pattern
(x <= 0 ? -x : 0) now gets optimized to max(-x, 0), which helps with the other
simplification rule.
Tests are also included to be added to