forwprop: Pattern recognize more rotates [PR94344]
authorJakub Jelinek <jakub@redhat.com>
Tue, 31 Mar 2020 09:02:47 +0000 (11:02 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 31 Mar 2020 09:02:47 +0000 (11:02 +0200)
commit56f0b32476c0c261c8e08525f9e47fe87492447a
tree9bd8bdfd482cd1e573cbe745c71bb9aae5a741dd
parent3809bcd6c0ee324cbd855c68cee104c8bf134dbe
forwprop: Pattern recognize more rotates [PR94344]

The following patch adjusts simplify_rotate to recognize more rotates,
basically we allow even some same precision integral -> integral
conversions, with the requirement that the RSHIFT_EXPR operand has to be
done in unsigned type (i.e. logical right shift), so that we compensate for
the combiner no longer being able to simplify those into rotates on some
targets.

2020-03-31  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/94344
* tree-ssa-forwprop.c (simplify_rotate): Handle also same precision
conversions, either on both operands of |^+ or just one.  Handle
also extra same precision conversion on RSHIFT_EXPR first operand
provided RSHIFT_EXPR is performed in unsigned type.

* gcc.dg/pr94344.c: New test.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr94344.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c