This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Aug 2017 11:32:53 +0200
- Subject: Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7231581229
- References: <20170803082625.GQ2123@tucnak> <alpine.LSU.2.20.1708031055440.10808@zhemvz.fhfr.qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 03, 2017 at 10:58:07AM +0200, Richard Biener wrote:
> > The reason why we punt is the unexpected _4 != 1 condition, the code
> > is prepared to handle just _4 == 0 (or _4 != 0) where _4 == 0 is equivalent
> > to _4 != 1 for boolean type.
>
> Hmm, I thought we had code to canonicalize boolean compares (but I can't
> find that right now). Some is in
I was looking for that too, but didn't find anything that would be done
always.
> forwprop:forward_propagate_into_gimple_cond where it canonicalizes
> != 1 to == 0.
Yes, but from
Canonicalize _Bool == 0 and _Bool != 1 to _Bool != 0 by swapping edges.
it seems that it can keep _Bool == 1 around, which is something
optimize_range_tests_var_bound didn't handle before either and now does.
Jakub