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

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 7:42 PM, H.J. Lu wrote: On Thu, Oct 14, 2021 at 11:06 AM Andrew MacLeod via Gcc-patches wrote: 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 f

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

2021-10-14 Thread H.J. Lu via Gcc-patches
On Thu, Oct 14, 2021 at 11:06 AM Andrew MacLeod via Gcc-patches wrote: > > 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 perfor

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

2021-10-14 Thread Andrew MacLeod via Gcc-patches
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 regressio