This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Do not use invalidated log links
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Fri, 23 Jan 2004 01:03:07 +0100
- Subject: Do not use invalidated log links
Hi,
while working on the log link reorganization I noticed that regmove is using
log links even tought the log links are invalidated already by earlier passes
(and not present at all with my patch).
I tried to either extend lifetime of log links up to the call but it just slow
down. The loop in the function is followed by other loop that walks the whole
instruction chain, so I guess it is OK to simply walk the basic block.
If this would turn out to be too costy we can just maintain table about
registers that are set to the constant, but I never really saw it in profiles.
Bootstrapped/regtested i686-pc-gnu, OK?
Honza
2004-01-23 Jan Hubicka <jh@suse.cz>
* regmove.c (reg_is_remote_constant_p): Reorganize to not use log links.
Index: regmove.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.153
diff -c -3 -p -r1.153 regmove.c
*** regmove.c 21 Jan 2004 20:40:03 -0000 1.153
--- regmove.c 22 Jan 2004 18:58:12 -0000
*************** reg_is_remote_constant_p (rtx reg, rtx i
*** 857,869 ****
return 0;
/* Look for the set. */
! for (p = LOG_LINKS (insn); p; p = XEXP (p, 1))
{
rtx s;
! if (REG_NOTE_KIND (p) != 0)
continue;
! s = single_set (XEXP (p, 0));
if (s != 0
&& GET_CODE (SET_DEST (s)) == REG
&& REGNO (SET_DEST (s)) == REGNO (reg))
--- 857,869 ----
return 0;
/* Look for the set. */
! for (p = BB_HEAD (BLOCK_FOR_INSN (insn)); p != insn; p = NEXT_INSN (p))
{
rtx s;
! if (!INSN_P (p))
continue;
! s = single_set (p);
if (s != 0
&& GET_CODE (SET_DEST (s)) == REG
&& REGNO (SET_DEST (s)) == REGNO (reg))