This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/45685] [4.7/4.8/4.9 Regression] missed conditional move opportunity in loop


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]