]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* bitmap.c (bitmap_descriptor): Add search_iter.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jun 2010 11:53:16 +0000 (11:53 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jun 2010 11:53:16 +0000 (11:53 +0000)
(bitmap_find_bit): Increment it.
(print_statistics): Print it.

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

gcc/ChangeLog
gcc/bitmap.c

index 10bf38dff67f2d02858cca58155fa6cb6a0c69d1..67b0078e8e24c7cb6654856cff9057378cafe208 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-02  Jan Hubicka  <jh@suse.cz>
+
+       * bitmap.c (bitmap_descriptor): Add search_iter.
+       (bitmap_find_bit): Increment it.
+       (print_statistics): Print it.
+
 2010-06-02  Nathan Froyd  <froydnj@codesourcery.com>
 
        * tree-vect-slp.c (vect_create_mask_and_perm): Use gimple_build_call
index f7309a02c577464ccecdf6bb063fc836f9673f4b..8f4a56606bd8f487e66d08e4fbc8c844dbd38637 100644 (file)
@@ -42,6 +42,7 @@ struct bitmap_descriptor
   HOST_WIDEST_INT peak;
   HOST_WIDEST_INT current;
   int nsearches;
+  int search_iter;
 };
 
 /* Hashtable mapping bitmap names to descriptors.  */
@@ -556,12 +557,12 @@ bitmap_find_bit (bitmap head, unsigned int bit)
   bitmap_element *element;
   unsigned int indx = bit / BITMAP_ELEMENT_ALL_BITS;
 
-#ifdef GATHER_STATISTICS
-  head->desc->nsearches++;
-#endif
   if (head->current == 0
       || head->indx == indx)
     return head->current;
+#ifdef GATHER_STATISTICS
+  head->desc->nsearches++;
+#endif
 
   if (head->indx < indx)
     /* INDX is beyond head->indx.  Search from head->current
@@ -569,7 +570,11 @@ bitmap_find_bit (bitmap head, unsigned int bit)
     for (element = head->current;
         element->next != 0 && element->indx < indx;
         element = element->next)
+#ifdef GATHER_STATISTICS
+      head->desc->search_iter++;
+#else
       ;
+#endif
 
   else if (head->indx / 2 < indx)
     /* INDX is less than head->indx and closer to head->indx than to
@@ -577,7 +582,11 @@ bitmap_find_bit (bitmap head, unsigned int bit)
     for (element = head->current;
         element->prev != 0 && element->indx > indx;
         element = element->prev)
+#ifdef GATHER_STATISTICS
+      head->desc->search_iter++;
+#else
       ;
+#endif
 
   else
     /* INDX is less than head->indx and closer to 0 than to
@@ -585,7 +594,11 @@ bitmap_find_bit (bitmap head, unsigned int bit)
     for (element = head->first;
         element->next != 0 && element->indx < indx;
         element = element->next)
+#ifdef GATHER_STATISTICS
+      head->desc->search_iter++;
+#else
       ;
+#endif
 
   /* `element' is the nearest to the one we want.  If it's not the one we
      want, the one we want doesn't exist.  */
@@ -2115,8 +2128,9 @@ print_statistics (void **slot, void *b)
       sprintf (s, "%s:%i (%s)", s1, d->line, d->function);
       s[41] = 0;
       fprintf (stderr, "%-41s %8d %15"HOST_WIDEST_INT_PRINT"d %15"
-              HOST_WIDEST_INT_PRINT"d %15"HOST_WIDEST_INT_PRINT"d %10d\n",
-              s, d->created, d->allocated, d->peak, d->current, d->nsearches);
+              HOST_WIDEST_INT_PRINT"d %15"HOST_WIDEST_INT_PRINT"d %10d %10d\n",
+              s, d->created, d->allocated, d->peak, d->current, d->nsearches,
+              d->search_iter);
       i->size += d->allocated;
       i->count += d->created;
     }
@@ -2134,8 +2148,8 @@ dump_bitmap_statistics (void)
     return;
 
   fprintf (stderr, "\nBitmap                                     Overall "
-                  "   Allocated        Peak           Leak   searched "
-                  "  per search\n");
+                  "      Allocated            Peak            Leak   searched "
+                  "  search itr\n");
   fprintf (stderr, "---------------------------------------------------------------------------------\n");
   info.count = 0;
   info.size = 0;