This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Move ~X | X -> -1 folding
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Tue, 30 Jun 2015 11:08:35 +0200 (CEST)
- Subject: Re: [PATCH] Move ~X | X -> -1 folding
- Authentication-results: sourceware.org; auth=none
- References: <20150630084620 dot GN10139 at redhat dot com>
- Reply-to: gcc-patches at gcc dot gnu dot org
On Tue, 30 Jun 2015, Marek Polacek wrote:
This moves a simple optimization. Here it's plain to see how :c
removes the need to duplicate code to handle commutativity.
Note that the same transformation would work for plus and xor.
I put some more converts into the pattern, but then it's turned
out that I also need the tree_nop_conversion_p (otherwise we'd
regress binop-notor2.c that uses booleans).
I don't really see why removing tree_nop_conversion_p would regress
anything (though you would probably need to build the all_ones constant in
TREE_TYPE (@0) and convert that to type). For my curiosity, could you
explain a bit more?
--
Marc Glisse