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

Vladimir Makarov <vmakarov at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #4 from Vladimir Makarov <vmakarov at redhat dot com> 2012-02-15 
19:34:06 UTC ---
(In reply to comment #3)
> The -1000 costs comes from the scan_one_insn subtracting there
> ira_memory_move_cost[][][] * frequency (i.e. memory_cost becomes -4000) and
> on the plus we add just 3000 to memory_cost.
> I wonder if we shouldn't limit this subtraction of mem_cost / setting of
> counted_mem e.g. to general_operand (SET_SRC (set), GET_MODE (SET_SRC (set)))
> and leave the specialized memory loads alone (I know, it would be a hack, but
> works for this and shouldn't pessimize the cases for which this hunk has been
> added).

I would not name this a hack, Jakub.  It is a heuristic :)  This solution is ok
for me.  I checked SPEC2000 and did not find any effect of this patch on
generated code. So the patch is ok but it would be great if you add some
comment for the change. 

  And would at least tiny bit model what reload will do with such
> non-standard mems - as on this testcase it doesn't use the orignal mem, but
> does the load, followed by store to another mem, followed by load from that
> mem.
> 
> --- ira-costs.c.jj 2012-01-20 12:35:17.000000000 +0100
> +++ ira-costs.c 2012-02-14 14:54:52.297356053 +0100
> @@ -1313,7 +1313,8 @@ scan_one_insn (rtx insn)
>    || (CONSTANT_P (XEXP (note, 0))
>        && targetm.legitimate_constant_p (GET_MODE (SET_DEST (set)),
>                                          XEXP (note, 0))
> -      && REG_N_SETS (REGNO (SET_DEST (set))) == 1)))
> +      && REG_N_SETS (REGNO (SET_DEST (set))) == 1))
> +      && general_operand (SET_SRC (set), GET_MODE (SET_SRC (set))))
>      {
>        enum reg_class cl = GENERAL_REGS;
>        rtx reg = SET_DEST (set);

Reply via email to