public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: regmove.c inconsistencies
  1998-07-13  0:06 regmove.c inconsistencies John Wehle
@ 1998-07-12 22:49 ` Jeffrey A Law
  1998-07-13 23:22 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1998-07-12 22:49 UTC (permalink / raw)
  To: John Wehle; +Cc: egcs, egcs-patches

  In message < 199807130429.AAA17945@jwlab.FEITH.COM >you write:
  > The following inconsistencies came up while looking into the i386
  > performance regression due to the June 11 regmove change.
Yes, regmove is inconsistent in its handling of REG_N_SETS/REFS.

The code to update the SETS/REFS is slated to go away after egcs-1.1
branches.  It was made obsolete by the "count_reg_usage" change.


jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

* regmove.c inconsistencies
@ 1998-07-13  0:06 John Wehle
  1998-07-12 22:49 ` Jeffrey A Law
  1998-07-13 23:22 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: John Wehle @ 1998-07-13  0:06 UTC (permalink / raw)
  To: egcs; +Cc: egcs-patches

The following inconsistencies came up while looking into the i386
performance regression due to the June 11 regmove change.

  1) In copy_src_to_dest is:

       REG_N_SETS (dest_regno) += loop_depth;

     however the rest of regmove.c merely increments (or decrements)
     REG_N_SETS by one.

  2) In copy_src_to_dest is:

       REG_N_REFS (dest_regno) += loop_depth;

     however it would seem that the number of references should be
     changed by a factor of two since src has been replaced by dest
     in insn and a move instruction has been added which sets dest.

  3) Could someone comment on the theory behind loop_depth?

Attached is a patch which changes copy_src_to_dest to be consistent with
the apparent usage of REG_N_SETS and REG_N_REFS in the rest of regmove.c
Don't know if this patch is correct ... I really wish someone knowledgeable
about regmove would speak up regarding these issues.

ChangeLog:

Sun Jul 12 23:02:54 EDT 1998  John Wehle  (john@feith.com)

	* regmove.c (copy_src_to_dest): Correct the updating of
	REG_N_SETS and REG_N_REFS for dest_regno.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/regmove.c.ORIGINAL	Sat Jul 11 02:17:21 1998
--- gcc/regmove.c	Sun Jul 12 23:05:02 1998
***************
*** 610,617 ****
  
        /* Update the various register tables.  */
        dest_regno = REGNO (dest);
!       REG_N_SETS (dest_regno) += loop_depth;
!       REG_N_REFS (dest_regno) += loop_depth;
        REG_LIVE_LENGTH (dest_regno)++;
        if (REGNO_FIRST_UID (dest_regno) == insn_uid)
  	REGNO_FIRST_UID (dest_regno) = move_uid;
--- 610,617 ----
  
        /* Update the various register tables.  */
        dest_regno = REGNO (dest);
!       REG_N_SETS (dest_regno)++;
!       REG_N_REFS (dest_regno) += 2 * loop_depth;
        REG_LIVE_LENGTH (dest_regno)++;
        if (REGNO_FIRST_UID (dest_regno) == insn_uid)
  	REGNO_FIRST_UID (dest_regno) = move_uid;
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: regmove.c inconsistencies
  1998-07-13  0:06 regmove.c inconsistencies John Wehle
  1998-07-12 22:49 ` Jeffrey A Law
@ 1998-07-13 23:22 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 1998-07-13 23:22 UTC (permalink / raw)
  To: John Wehle, egcs; +Cc: egcs-patches

On Mon, Jul 13, 1998 at 12:29:55AM -0400, John Wehle wrote:
>   3) Could someone comment on the theory behind loop_depth?

I believe it was intended to prefer registers for those pseudos
found in inner loops.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-07-13 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-13  0:06 regmove.c inconsistencies John Wehle
1998-07-12 22:49 ` Jeffrey A Law
1998-07-13 23:22 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).