This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: match.pd: ~X & Y to X ^ Y in some cases
- From: Jeff Law <law at redhat dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 May 2016 14:27:27 -0600
- Subject: Re: match.pd: ~X & Y to X ^ Y in some cases
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1605132050510 dot 21219 at laptop-mg dot saclay dot inria dot fr>
On 05/13/2016 01:07 PM, Marc Glisse wrote:
Hello,
maybe this would fit better in VRP, but it is easier (and not completely
useless) to put it in match.pd.
Since the transformation is restricted to GIMPLE, I think I don't need
to check that @0 is SSA_NAME. I didn't test if @0 has pointer type
before calling get_range_info because we are doing bit_not on it, but it
looks like I should because we can do bitops on pointers?
Adjustment for pr69270.c is exactly the same as in the previous patch
from today :-)
Bootstrap+regtest on powerpc64le-unknown-linux-gnu.
2016-05-16 Marc Glisse <marc.glisse@inria.fr>
gcc/
* match.pd (~X & Y): New transformation.
gcc/testsuite/
* gcc.dg/tree-ssa/pr69270.c: Adjust.
* gcc.dg/tree-ssa/andnot-1.c: New testcase.
Please use if (GIMPLE
&& ((get_nonzero_bits ...)
Rather than #if GIMPLE
With that, OK.
jeff