On Tue, 16 Aug 2022, Aldy Hernandez wrote:

> On Thu, Aug 11, 2022 at 1:42 PM Richard Biener <rguent...@suse.de> wrote:
> 
> > @@ -599,6 +592,30 @@ path_range_query::compute_imports (bitmap imports, 
> > const vec<basic_block> &path)
> >                 worklist.safe_push (arg);
> >             }
> >         }
> > +      else if (gassign *ass = dyn_cast <gassign *> (def_stmt))
> > +       {
> > +         tree ssa[3];
> > +         if (range_op_handler (ass))
> > +           {
> > +             ssa[0] = gimple_range_ssa_p (gimple_range_operand1 (ass));
> > +             ssa[1] = gimple_range_ssa_p (gimple_range_operand2 (ass));
> > +             ssa[2] = NULL_TREE;
> > +           }
> > +         else if (gimple_assign_rhs_code (ass) == COND_EXPR)
> > +           {
> > +             ssa[0] = gimple_range_ssa_p (gimple_assign_rhs1 (ass));
> > +             ssa[1] = gimple_range_ssa_p (gimple_assign_rhs2 (ass));
> > +             ssa[2] = gimple_range_ssa_p (gimple_assign_rhs3 (ass));
> > +           }
> > +         else
> > +           continue;
> > +         for (unsigned j = 0; j < 3; ++j)
> > +           {
> > +             tree rhs = ssa[j];
> > +             if (rhs && add_to_imports (rhs, imports))
> > +               worklist.safe_push (rhs);
> > +           }
> > +       }
> 
> We seem to have 3 copies of this copy now: this one, the
> threadbackward one, and the original one.
> 
> Could we abstract this somehow?

I've thought about this but didn't find any good solution since the
use of the operands is always a bit different.  But I was wondering
why/if the COND_EXPR special-casing is necessary, that is, why
don't we have a range_op_handler for it and if we don't why
do we care about it?

Richard.

Reply via email to