[COMMITTED] tree-optimization/102738 - Simplification for right shift.

Andrew MacLeod amacleod@redhat.com
Thu Oct 14 18:02:35 GMT 2021


As the PR observes, if the first operand of a right shift is 0 or -1, 
operand 2 doesn't matter and the result will be the same as op1, so it 
can be turned into a copy.

This patch checks for that condition and performs the operation in EVRP.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.

Andrew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 738.patch
Type: text/x-patch
Size: 2630 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211014/19d6441e/attachment.bin>


More information about the Gcc-patches mailing list