https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90106

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2019-04-16
                 CC|                            |amonakov at gcc dot gnu.org
         Resolution|INVALID                     |---
     Ever confirmed|0                           |1

--- Comment #6 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Reopening and confirming, GCC's code looks less efficient than possible for no
good reason.

CDCE does

        y = sqrt (x);
     ==>
        y = IFN_SQRT (x);
        if (__builtin_isless (x, 0))
            sqrt (x);

but it could do

        y = IFN_SQRT (x);
        if (__builtin_isless (x, 0))
            y = sqrt (x);

(note two assignments to y)

or to mimic LLVM's approach:

        if (__builtin_isless (x, 0))
            y = sqrt (x);
        else
            y = IFN_SQRT (x);

Reply via email to