On Tue, 2017-06-27 at 16:45 -0600, Jeff Law wrote:

> > +  /* If we have a boolean variable allow it and generate a compare
> > +     to zero reg when expanding.  */
> > +  if (!g)
> > +    return (TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE);
> Depending on how you use T, you might be better off checking T's range
> and considering anything with the [0,1] range as a boolean.  That would
> also pick up the case where T was set via a comparison, or the output of
> a PHI with arguments that are all [0,1], etc.  I've found that to be a
> useful improvement in a couple places.
> 
> See ssa_name_has_boolean_range.  I don't consider it a requirement for
> this patch to go forward, but more something you might want to
> investigate as a future improvement.
> 
> OK for the trunk.  Sorry about the delay.
> 
> jeff

Thanks Jeff, I checked this in.  I hadn't considered integers with a
restricted range but it might be worth adding.  I will look into that.

Steve Ellcey
sell...@cavium.com

Reply via email to