This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Updated new sparse bitmap patch
- From: Olga Golovanevsky <OLGA at il dot ibm dot com>
- To: "Daniel Berlin" <dberlin at dberlin dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Mar 2007 16:49:11 +0200
- Subject: Re: [PATCH]: Updated new sparse bitmap patch
I am thinking to use ebitmap for struct-reorg implementation.
In struct-reorg, sbitmaps are used for structure fields.
Thus they are usually small, and can fit in one or two EBITMAP_ELT_TYPEs.
Would it be still more efficiently to use ebitmap instead of sbitmap?
My guess that it will be because of cached element.
Olga
On 23/20/07, Daniel Berlin <dberlin@dberlin.org> wrote:
> +/* Set BIT in ebitmap MAP. */
> +
> +void
> +ebitmap_set_bit (ebitmap map, unsigned int bit)
> +{
> + unsigned int wordindex = bit / EBITMAP_ELT_BITS;
> + unsigned int eltwordindex;
> + unsigned int bitindex;
> +
> +
> + /* If we have this element cached, just set the bit in it. */
> + if (map->cache && map->cacheindex == wordindex)
> + {
> + (*map->cache) |= (EBITMAP_ELT_TYPE)1 << bitindex;
> + return;
> + }
bitindex is used uninitialized.