public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steven Bosscher <stevenb.gcc@gmail.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Michael Matz <matz@suse.de>,
	Richard Biener <richard.guenther@gmail.com>,
		GCC Patches <gcc-patches@gcc.gnu.org>, Jeff Law <law@redhat.com>
Subject: Re: [patch][RFC] bitmaps as lists *or* trees
Date: Wed, 06 Mar 2013 18:07:00 -0000	[thread overview]
Message-ID: <CABu31nMxdmR=MYthD_YNXDBqfXmG3XUOrM_9_neus5hv1PAkyw@mail.gmail.com> (raw)
In-Reply-To: <20130306160622.GC27815@atrey.karlin.mff.cuni.cz>

On Wed, Mar 6, 2013 at 5:06 PM, Jan Hubicka wrote:
> And for the RFC, i also find it interesting experiment.  I implemented some
> time ago splay tree based bitmap with API same as bitmap's but never attempted
> to put it to mainline since Danny introduced his ebitmap and there was a lot of
> discussion about whether one needs more than one bitmap in the compiler.  I

Right, I think the ebitmap.c experiment shows that there is *not* room
for another bitmap implementation. This is why I developed these
splay-tree bitmaps using the same data structures as the existing
linked-list sparse bitmaps: Not another bitmap, just another way of
looking at the existing bitmap. I required that changing the view of
the bitmap from linked-list to splay tree and vv. to be almost free.


> never experimented with bitmap.c change itself, just tested that replacing all
> bitmaps by tree based ones causes quite some memory consumption on RA side
> (with old RA) because bitmaps are pretty good for regsets they were introduced
> for.

Memory consumption as in higher peak memory? That cannot happen with
my splay-tree bitmaps. They take exactly the same amount of memory,
independent of whether the current view on the bitmap is linked-list
or splay tree. As for cache behavior or number of memory operations
(loads, stores) I think this is directly correlated to the lookup
success ratio, hence the access pattern, and so if the right view on
the bitmap is selected for the right circumstances then the number of
memory ops should also be no worse in splay tree view than in
linked-list view.

Another idea I'm currently (right now on gcc17 ;-) working on, is a
trivial speed-up for bitmaps used as regsets. The idea is that
bitmap_find_bit should look at head->first if head->current is not the
element containing the sought bit, and *not* update head->current if
head->first is the right element.  This speeds up regsets because a
common access pattern is to look at sets containing both pseudos and
hardregs, and on most targets all hardregs are in head->first.  Not
updating head->current preserves a pointer to the latest accessed
pseudos.

I'll implement this idea and come back with some timings.

Ciao!
Steven

  reply	other threads:[~2013-03-06 18:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 12:01 Steven Bosscher
2013-03-05 12:32 ` Richard Biener
2013-03-05 14:48   ` Michael Matz
2013-03-05 16:17     ` Steven Bosscher
2013-03-05 22:56       ` Steven Bosscher
2013-03-07 20:18         ` Steven Bosscher
2018-10-17 14:04           ` Richard Biener
2013-03-06 10:18       ` Richard Biener
2013-03-06 16:02       ` Jan Hubicka
2013-03-06 16:06         ` Jan Hubicka
2013-03-06 18:07           ` Steven Bosscher [this message]
2013-03-06 17:59         ` Steven Bosscher
2013-03-06 18:03           ` Jan Hubicka
2013-03-05 14:51   ` Steven Bosscher
2013-03-05 16:03     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABu31nMxdmR=MYthD_YNXDBqfXmG3XUOrM_9_neus5hv1PAkyw@mail.gmail.com' \
    --to=stevenb.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=law@redhat.com \
    --cc=matz@suse.de \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).