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



--- Comment #5 from Vladimir Makarov <vmakarov at gcc dot gnu.org> 2013-02-15 
16:48:19 UTC ---

(In reply to comment #4)

> Perhaps for regmove IRA classes should be set up unconditionally:

> 

> Index: regmove.c

> ===================================================================

> --- regmove.c   (revision 196074)

> +++ regmove.c   (working copy)

> @@ -1234,8 +1234,9 @@ regmove_optimize (void)

>    regstat_init_n_sets_and_refs ();

>    regstat_compute_ri ();

> 

> -  if (flag_ira_loop_pressure)

> -    ira_set_pseudo_classes (true, dump_file);

> +  /* Set up register classes for pseudos, so that reg_preferred_class

> +     returns a more useful result.  */

> +  ira_set_pseudo_classes (true, dump_file);

> 

>    regno_src_regno = XNEWVEC (int, nregs);

>    for (i = nregs; --i >= 0; )

> @@ -1256,8 +1257,7 @@ regmove_optimize (void)

>      }

>    regstat_free_n_sets_and_refs ();

>    regstat_free_ri ();

> -  if (flag_ira_loop_pressure)

> -    free_reg_info ();

> +  free_reg_info ();

>    return 0;

>  }



It can be a solution.  I see only one drawback, it is expensive.  Setting

classes is expensive procedure requiring 2 passes over all insns, their

alternatives,and classes for each pseudo operand.



In general, it still will not work for other cases.  We are lucky that xmm0

forms own class SSE_FIRST_REG.  Regmove for general cases should see hard regs

not classes.



This is not the first PR about regmove.  I'd like to remove big part of regmove

concerning matching operands as IRA/LRA can deal with this.  Unfortunately, not

too well when hard regs exposed in RTL and some work should be done to improve

this code.  I am going to do for gcc4.9.

Reply via email to