This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: match.pd: Optimize (x & y) ^ (x | y)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Thu, 11 Jun 2015 14:02:46 +0200
- Subject: Re: match.pd: Optimize (x & y) ^ (x | y)
- Authentication-results: sourceware.org; auth=none
- References: <20150611110432 dot GY2756 at redhat dot com> <20150611110905 dot GW10247 at tucnak dot redhat dot com>
On Thu, Jun 11, 2015 at 01:09:05PM +0200, Jakub Jelinek wrote:
> What about some nop type conversions in between?
> int
> fn1 (unsigned int x, unsigned int y)
> {
> int a = x;
> int b = y;
> unsigned int c = x & y;
> int d = a | b;
> return (int) (c ^ d);
> }
> ? Also wonder, if some testcases for match.pd shouldn't be
It doesn't work then. Adding some convert?s into the pattern didn't help
either. Note that similar patterns don't use convert?s either, so I'm
inclined to keep the pattern as is was.
> in separate statements so that they don't test the GENERIC folding,
> but GIMPLE folding.
Sure - fixed in second version of the patch that I'm regtesting right now.
Marek