> On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen
> <naveen.hurugalaw...@caviumnetworks.com> wrote:
>
> Hi,
>
> Please find attached the patch which performs following patterns folding
> in match.pd:-
>
> a ==/!= a p+ b to b ==/!= 0.
> a << N ==/!= 0 to a&(-1>>N) ==/!= 0.
> a * N ==/!= 0 where N is a power of 2 to a & (-1<<N2) ==/!= 0 where N2 is
> log2 of N.
>
> Please review the same and let us know if its okay?
I should note this shows up in perlbmk in spec 2006.
Thanks,
Andrew
>
> Regression Tested on X86_64.
>
> On Behalf of Andrew Pinski.
>
> Thanks,
>
> gcc/testsuite/ChangeLog:
>
> 2015-01-21 Andrew Pinski <apin...@cavium.com>
>
> * testsuite/gcc.dg/tree-ssa/compare-shiftmult-1.c: New testcase.
> * testsuite/gcc.dg/tree-ssa/compare_pointers-1.c: New testcase.
>
> gcc/ChangeLog:
>
> 2015-01-21 Andrew Pinski <apin...@cavium.com>
>
> * match.pd (define_predicates): Add integer_pow2p.
> Add pattern for folding of a ==/!= a p+ b to b ==/!= 0.
> (unsigned_integral_valued_p): New match.
> Add pattern for folding of a<<N ==/!= 0 to a&(-1>>N) ==/!= 0.
> Add pattern for folding of a*N ==/!= 0 where N is a power of 2
> to a&(-1<<N2) ==/!= 0 where N2 is log2 of N.
> <gcc_match.patch>