From: Dimitrios Apostolou <jimis@gmx.net>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Paolo Bonzini <bonzini@gnu.org>,
Steven Bosscher <stevenb.gcc@gmail.com>
Subject: Re: [df-scan.c] Optimise DF_REFs ordering in collection_rec, use HARD_REG_SETs instead of bitmaps
Date: Fri, 08 Jul 2011 10:20:00 -0000 [thread overview]
Message-ID: <alpine.LNX.2.02.1107081306330.1237@localhost.localdomain> (raw)
In-Reply-To: <CAFiYyc0vguN7Mnz2jGsfwf6-9G=VbudbHGoUvxjveSytyTMKxg@mail.gmail.com>
On Fri, 8 Jul 2011, Richard Guenther wrote:
> On Fri, Jul 8, 2011 at 5:20 AM, Dimitrios Apostolou <jimis@gmx.net> wrote:
>> Hello list,
>>
>> The attached patch does two things for df_get_call_refs():
>> * First it uses HARD_REG_SETs for defs_generated and
>> regs_invalidated_by_call, instead of bitmaps. Replacing in total more than
>> 400K calls (for my testcase) to bitmap_bit_p() with the much faster
>> TEST_HARD_REG_BIT, reduces the total instruction count from about 13M to
>> 1.5M.
>> * Second it produces the REFs in REGNO order, which is important to keep the
>> collection_rec sorted most times, and avoid expensive calls to qsort().
>> Thanks to Paolo Bonzini for idea and mentoring.
>>
>> The second part makes a big difference if accompanied with another patch in
>> df_insn_refs_collect(). I'll post a followup patch, that is unfortunately
>> unstable for some of my tests, so I'd appreciate any comments.
>
> Did you check the impact on memory usage? I suppose on targets
> with not many hard registers it should even improve, but do we expect
> memory usage to be worse in any case?
Hi Richard, I didn't check memory usage, is that important? Since the
struct bitmap is fairly bulky, it should take an arch with lots of hard
regs (which one has the most?).
But still a few bytes tradeoff wouldn't be acceptable for a much faster
type? And IMHO it makes the code better to understand, since once you see
HARD_REG_SET you know you can't expect else. FWIW I'm now in the process
of converting all other bitmap uses for hard regs, to HARD_REG_SETs, at
least within DF. I'm not sure whether performance gains will be visible,
however, not much code is as hot as df_get_call_refs().
Thanks,
Dimitris
prev parent reply other threads:[~2011-07-08 10:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-08 3:33 Dimitrios Apostolou
2011-07-08 3:52 ` Dimitrios Apostolou
2011-07-08 6:36 ` Dimitrios Apostolou
2011-07-08 7:12 ` Paolo Bonzini
2011-07-09 1:29 ` Dimitrios Apostolou
2011-07-08 6:37 ` Steven Bosscher
2011-07-08 7:04 ` Dimitrios Apostolou
2011-07-08 6:59 ` Jakub Jelinek
2011-07-08 9:09 ` Dimitrios Apostolou
2011-07-08 14:22 ` Paolo Bonzini
2011-07-08 14:25 ` Paolo Bonzini
2011-07-08 8:42 ` Richard Guenther
2011-07-08 10:20 ` Dimitrios Apostolou [this message]
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=alpine.LNX.2.02.1107081306330.1237@localhost.localdomain \
--to=jimis@gmx.net \
--cc=bonzini@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
--cc=stevenb.gcc@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).