https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125167
--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Some concrete forms that we ought to be able to optimize. I'm thinking these
are likely best done in ifcvt.cc:
long foo2(long c, long a, long b) { return (c < 0 ? a : b); }
long foo3(long c, long a) { return (c < 0 ? 16383 : 0); }
These are both generating conditional branch sequences, even though there are
good straightline code sequences.
foo2's best sequence is the non-intuitive srai+xor+and+xor which is better than
paired czeros because it is going to encode more efficiently most of the time.
foo3 I expected to be handled by pr124009, but the constant is out of range, so
we don't do a good job with it.
We're using sign-bit-splat to handle stuff like (c < 0 ? -16384 : 0) using
srai+slli, so those are good.