This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/45685] [4.7/4.8/4.9 Regression] missed conditional move opportunity in loop
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Dec 2013 06:16:11 +0000
- Subject: [Bug tree-optimization/45685] [4.7/4.8/4.9 Regression] missed conditional move opportunity in loop
- Auto-submitted: auto-generated
- References: <bug-45685-4 at http dot gcc dot gnu dot 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.