From: hubicka Date: Wed, 2 Jun 2010 11:53:16 +0000 (+0000) Subject: * bitmap.c (bitmap_descriptor): Add search_iter. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83539c44a5660e6af2bef54c780d454d52bd71e2;p=thirdparty%2Fgcc.git * bitmap.c (bitmap_descriptor): Add search_iter. (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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 10bf38dff67f..67b0078e8e24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-06-02 Jan Hubicka + + * bitmap.c (bitmap_descriptor): Add search_iter. + (bitmap_find_bit): Increment it. + (print_statistics): Print it. + 2010-06-02 Nathan Froyd * tree-vect-slp.c (vect_create_mask_and_perm): Use gimple_build_call diff --git a/gcc/bitmap.c b/gcc/bitmap.c index f7309a02c577..8f4a56606bd8 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -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;