This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: match.pd: ~X & Y to X ^ Y in some cases


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]