On Thu, Mar 16, 2017 at 09:03:43AM -0600, Jeff Law wrote:
> On 03/16/2017 06:54 AM, Trevor Saunders wrote:
> > > +   if (TREE_CODE (op0) == SSA_NAME && integer_zerop (op1))
> > > +     {
> > > +       enum tree_code code = eq->cond.ops.binary.op;
> > > +       if ((code == EQ_EXPR && eq->value == boolean_true_node)
> > > +           || (code == NE_EXPR && eq->value == boolean_false_node))
> > > +         derive_equivalencs_from_bit_ior (op0, const_and_copies);
> > > +
> > > +       /* TODO: We could handle BIT_AND_EXPR in a similar fashion
> > > +          recording that the operands have a nonzero value.  */
> > > +
> > > +       /* TODO: We can handle more cases here, particularly when OP0 is
> > > +          known to have a boolean range.  */
> > 
> > I don't think its necessarily useful to put a list here of all possible
> > improvements, but we could also handle things like if ((a | b) </> 0)
> > since those imply !=.
> The equivalences you derive here must hold for both objects.  So without
> additional range information you can't really determine anything about (a |
> b) > 0.

ga! I clearly didn't think this all the way through, sorry.

Trev

Reply via email to