This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR rtl-optimization/28071
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Jul 2006 09:15:59 +0200
- Subject: PR rtl-optimization/28071
Hi,
this patch avoids most of remaining time spent in cselib (reload_cse
regs was about 107 seconds out of 600 seconds overall). The problem is
that cselib builds rather large hashtable of usefull values for it is
repeativly being pruned for useless every 30 instructions resulting in
quadratic behaviour.
Bootstrapped/regtested i686-linux
:ADDPATCH middle-end:
Honza
2006-07-27 Jan Hubicka <jh@suse.cz>
PR rtl-optimization/28071
* cselib.c (cselib_process_insn): Don't remove useless values too
often for very large hashtables.
Index: cselib.c
===================================================================
*** cselib.c (revision 115712)
--- cselib.c (working copy)
*************** cselib_process_insn (rtx insn)
*** 1437,1443 ****
cselib_current_insn_in_libcall = false;
cselib_current_insn = 0;
! if (n_useless_values > MAX_USELESS_VALUES)
remove_useless_values ();
}
--- 1437,1447 ----
cselib_current_insn_in_libcall = false;
cselib_current_insn = 0;
! if (n_useless_values > MAX_USELESS_VALUES
! /* remove_useless_values is linear in the hash table size. Avoid
! quadratic behaviour for very large hashtables with very few
! useless elements. */
! && (unsigned int)n_useless_values > cselib_hash_table->n_elements / 4)
remove_useless_values ();
}