------- Comment #10 from steven at gcc dot gnu dot org  2007-11-28 22:02 -------
> +  for (defs = DF_INSN_DEFS (insn);
> +       *defs && DF_REF_REGNO (*defs) != REGNO (x);
> +       defs++)
> +    ;

Are you aware of df_find_def() ?


> +       if (minus_elt)
> +           cmp = cse_find_comparison_use (dest, insn);

Formatting.


IMNSHO, computing DEF-USE chains for this niche optimization loses in the
cost/benefit trade-off.  The whole patch looks like a hack to me to
specifically deal with this particular bug report.  You could, of course, show
that this is actually a very important optimization...

I wonder if you can't just integrate this optimization in cse.c as-is by
recording an equivalence "a < b" == "signof(c)" when you process "a - b".

In any case, adding this optimization to cse.c is Just Wrong (tm).  I don't
understand why you didn't even try to optimize this in one of the tree
optimizers instead.  I thought it was clear GCC is trying to reduce its
dependency on RTL optimizations?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3507

Reply via email to