https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95729
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
Status|NEW |ASSIGNED
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
;; a != b ? a - b : 0
Something like:
(simplify
(cond (ne:c @0 @1) (minus@2 @0 @1) zero_p)
(if (!HONOR_NANS (type) && !HONOR_SIGNED_ZEROS (type))
@2)
(simplify
(cond (eq:c @0 @1) zero_p (minus@2 @0 @1))
(if (!HONOR_NANS (type) && !HONOR_SIGNED_ZEROS (type))
@2)
Note I noticed LLVM 13 no longer does this optimization (I wonder if they have
a testsuite).