This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]