OSDN Git Service

* tree-ssa-threadupdate.c (struct thread_stats_d): Declare.
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Jun 2005 21:01:14 +0000 (21:01 +0000)
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Jun 2005 21:01:14 +0000 (21:01 +0000)
(thread_stats): New local variable.
(redirect_edges): Increment count of threaded edges.
(thread_through_all_blocks): Initialize thread_stats.
Display number of threaded jumps if TDF_STATS is enabled.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100722 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-threadupdate.c

index 04974e5..74416ef 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-07  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-ssa-threadupdate.c (struct thread_stats_d): Declare.
+       (thread_stats): New local variable.
+       (redirect_edges): Increment count of threaded edges.
+       (thread_through_all_blocks): Initialize thread_stats.
+       Display number of threaded jumps if TDF_STATS is enabled.
+
 2005-06-07  Kazu Hirata  <kazu@codesourcery.com>
 
        * sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as
 2005-06-07  Kazu Hirata  <kazu@codesourcery.com>
 
        * sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as
index 25f6cdf..ea44137 100644 (file)
@@ -147,6 +147,16 @@ struct local_info
   bool jumps_threaded;
 };
 
   bool jumps_threaded;
 };
 
+/* Jump threading statistics.  */
+
+struct thread_stats_d
+{
+  unsigned long num_threaded_edges;
+};
+
+struct thread_stats_d thread_stats;
+
+
 /* Remove the last statement in block BB if it is a control statement
    Also remove all outgoing edges except the edge which reaches DEST_BB.
    If DEST_BB is NULL, then remove all outgoing edges.  */
 /* Remove the last statement in block BB if it is a control statement
    Also remove all outgoing edges except the edge which reaches DEST_BB.
    If DEST_BB is NULL, then remove all outgoing edges.  */
@@ -589,6 +599,8 @@ redirect_edges (void **slot, void *data)
          to clear it will cause all kinds of unpleasant problems later.  */
       e->aux = NULL;
 
          to clear it will cause all kinds of unpleasant problems later.  */
       e->aux = NULL;
 
+      thread_stats.num_threaded_edges++;
+
       if (rd->dup_block)
        {
          edge e2;
       if (rd->dup_block)
        {
          edge e2;
@@ -811,6 +823,7 @@ thread_through_all_blocks (bitmap threaded_blocks)
   bitmap_iterator bi;
 
   rediscover_loops_after_threading = false;
   bitmap_iterator bi;
 
   rediscover_loops_after_threading = false;
+  memset (&thread_stats, 0, sizeof (thread_stats));
 
   EXECUTE_IF_SET_IN_BITMAP (threaded_blocks, 0, i, bi)
     {
 
   EXECUTE_IF_SET_IN_BITMAP (threaded_blocks, 0, i, bi)
     {
@@ -820,5 +833,9 @@ thread_through_all_blocks (bitmap threaded_blocks)
        retval |= thread_block (bb);
     }
 
        retval |= thread_block (bb);
     }
 
+  if (dump_file && (dump_flags & TDF_STATS))
+    fprintf (dump_file, "\nJumps threaded: %lu\n",
+            thread_stats.num_threaded_edges);
+
   return retval;
 }
   return retval;
 }