public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/45685] [4.7/4.8/4.9 Regression] missed conditional move opportunity in loop
Date: Wed, 11 Dec 2013 06:16:00 -0000	[thread overview]
Message-ID: <bug-45685-4-iAsnNVEsvu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-45685-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45685

--- Comment #26 from Jeffrey A. Law <law at redhat dot com> ---
Looking at this again, I think there's another solution.  Basically we've got
conditional negation occurring in both loops.   There's a reasonably good
sequence to turn that into straight line code.

result = (input ^ -cond) + cond

Will negate the input when cond is true.  It looks a bit ugly, but
significantly helps simplify the first loop where we go from 23 insns down to
just 18 insns.  It helps the second loop as well, but the results aren't as
dramatic.

>From an implementation standpoint, it fits quite well into the existing phi-opt
code structure.


  parent reply	other threads:[~2013-12-11  6:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-45685-4@http.gcc.gnu.org/bugzilla/>
2010-09-29 18:34 ` [Bug rtl-optimization/45685] [4.6 Regression] GCC optimizer for Intel x64 generates inefficient code rguenth at gcc dot gnu.org
2010-11-04 17:41 ` jakub at gcc dot gnu.org
2010-11-24 15:32 ` ebotcazou at gcc dot gnu.org
2010-11-24 15:56 ` jakub at gcc dot gnu.org
2010-11-24 16:10 ` rguenth at gcc dot gnu.org
2010-11-24 19:15 ` [Bug tree-optimization/45685] [4.6 Regression] missed conditional move opportunity in loop ebotcazou at gcc dot gnu.org
2010-11-25  1:41 ` ekuznetsov at divxcorp dot com
2010-11-25 11:16 ` rguenth at gcc dot gnu.org
2011-01-24 17:05 ` law at redhat dot com
2011-02-17 19:47 ` law at redhat dot com
2011-02-17 19:47 ` law at redhat dot com
2011-12-01 22:42 ` [Bug tree-optimization/45685] [4.6/4.7 " jakub at gcc dot gnu.org
2011-12-02  5:27 ` law at redhat dot com
2011-12-02  9:53 ` rguenth at gcc dot gnu.org
2012-03-22  9:31 ` [Bug tree-optimization/45685] [4.6/4.7/4.8 " rguenth at gcc dot gnu.org
2012-06-14  8:52 ` rguenth at gcc dot gnu.org
2012-09-20 10:27 ` jakub at gcc dot gnu.org
2013-03-13 20:47 ` steven at gcc dot gnu.org
2013-04-11  8:00 ` [Bug tree-optimization/45685] [4.6/4.7/4.8/4.9 " rguenth at gcc dot gnu.org
2013-12-11  6:16 ` law at redhat dot com [this message]
2013-12-13 16:34 ` [Bug tree-optimization/45685] [4.7/4.8/4.9 " law at gcc dot gnu.org
2013-12-13 16:35 ` law at redhat dot com
2013-12-16  9:54 ` ktkachov at gcc dot gnu.org
2013-12-16  9:55 ` ktkachov at gcc dot gnu.org
2013-12-16 11:42 ` ktkachov at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-45685-4-iAsnNVEsvu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).