This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Speedup insn-attrtab build time
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Sep 2008 08:01:54 +0200
- Subject: Speedup insn-attrtab build time
Hi,
profiling insn-attrtab.o build, find_replaceable_exprs is consuming 15%
of compile time.
The problem is quadratic loop checking that table is empty after every
BB. This patch moves the loop out of the internal loop so only last BB
is sanity checked.
OK?
Honza
* tree-ssa-ter.c (find_replaceable_exprs): Avoid expensive enable checking loop.
Index: tree-ssa-ter.c
===================================================================
--- tree-ssa-ter.c (revision 140356)
+++ tree-ssa-ter.c (working copy)
@@ -665,21 +665,21 @@ find_replaceable_exprs (var_map map)
{
find_replaceable_in_bb (table, bb);
gcc_assert (bitmap_empty_p (table->partition_in_use));
+ }
#ifdef ENABLE_CHECKING
+ {
+ unsigned i;
+ /* Make sure all the tables have been cleared out. */
+ for (i = 0; i < num_ssa_names + 1; i++)
{
- unsigned i;
- /* Make sure all the tables have been cleared out. */
- for (i = 0; i < num_ssa_names + 1; i++)
- {
- gcc_assert (table->partition_dependencies[i] == NULL);
- gcc_assert (table->expr_decl_uids[i] == NULL);
- if (i < num_var_partitions (map))
- gcc_assert (table->kill_list[i] == NULL);
- }
+ gcc_assert (table->partition_dependencies[i] == NULL);
+ gcc_assert (table->expr_decl_uids[i] == NULL);
+ if (i < num_var_partitions (map))
+ gcc_assert (table->kill_list[i] == NULL);
}
+ }
#endif
- }
ret = free_temp_expr_table (table);
return ret;