This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc compile-time performance
From: Marc Espie <espie@quatramaran.ens.fr>
Date: Sat, 18 May 2002 13:46:43 +0200
In case you have missed this, I pitted gcc 2.95.3 -O2 against gcc 3.1 -O1,
to see which one was fastest. On the same source. Something big enough to
be relevant: a BSD kernel.
gcc 2.95.3 wins hands down, by about 20%.
Hey Marc, could you run your tests with this patch applied
to gcc-3.1? It should kill ~10% or more of the compile time
overhead when optimizations are enabled.
2002-05-17 David S. Miller <davem@redhat.com>
* cselib.c (cselib_invalidate_regno): Only walk over the
registers we actually need to look at.
--- cselib.c.~1~ Mon Feb 18 18:53:22 2002
+++ cselib.c Fri May 17 17:21:38 2002
@@ -947,6 +947,7 @@
{
unsigned int endregno;
unsigned int i;
+ enum machine_mode tmpmode, nxtmode;
/* If we see pseudos after reload, something is _wrong_. */
if (reload_completed && regno >= FIRST_PSEUDO_REGISTER
@@ -958,10 +959,30 @@
into account, and we must also invalidate lower register numbers
if they contain values that overlap REGNO. */
endregno = regno + 1;
- if (regno < FIRST_PSEUDO_REGISTER && mode != VOIDmode)
- endregno = regno + HARD_REGNO_NREGS (regno, mode);
+ if (regno < FIRST_PSEUDO_REGISTER && mode != VOIDmode)
+ {
+ endregno = regno + HARD_REGNO_NREGS (regno, mode);
- for (i = 0; i < endregno; i++)
+ tmpmode = reg_raw_mode[regno];
+ nxtmode = GET_MODE_WIDER_MODE (tmpmode);
+ while (HARD_REGNO_MODE_OK (regno, nxtmode))
+ {
+ tmpmode = nxtmode;
+ nxtmode = GET_MODE_WIDER_MODE (tmpmode);
+ }
+
+ i = HARD_REGNO_NREGS (regno, tmpmode);
+ if (regno < i)
+ i = 0;
+ else
+ i = regno - i;
+ }
+ else
+ {
+ i = regno;
+ }
+
+ for (; i < endregno; i++)
{
struct elt_list **l = ®_VALUES (i);