This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Jul 2017 17:46:50 +0200
- Subject: Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 875DB8046E
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 875DB8046E
- References: <20170718134730.GQ2123@tucnak> <alpine.DEB.2.20.1707181727380.2048@stedding.saclay.inria.fr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote:
> On Tue, 18 Jul 2017, Jakub Jelinek wrote:
>
> > In the PR Marc noted that the optimization might be useful even for
> > constants other than 1, by transforming
> > x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1).
>
> (int)x >= (int)(-C1) might be easier (and more valid, except that the only
> case where that makes a difference seems to be when C2==UINT_MAX, in which
> case we could hope not to reach this transformation).
Don't we canonicalize that (int)x >= (int)(-C1) to (int)x > (int)(-1-C1)
immediately though?
> > + && TYPE_PRECISION (TREE_TYPE (@0)) > 1
>
> I see you've been bitten in the past ;-)
Many times ;)
Jakub