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: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)


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


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