public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steven Bosscher <stevenb.gcc@gmail.com>
To: Duncan Sands <baldrick@free.fr>
Cc: gcc@gcc.gnu.org
Subject: Re: Where does the time go?
Date: Thu, 20 May 2010 21:14:00 -0000	[thread overview]
Message-ID: <AANLkTinSYt1d8f_30Wyq4XFBIewK2e5iikPFdIPAN0r4@mail.gmail.com> (raw)
In-Reply-To: <4BF5A181.5090003@free.fr>

On Thu, May 20, 2010 at 10:54 PM, Duncan Sands <baldrick@free.fr> wrote:
> I noticed while working on the dragonegg plugin that replacing gimple -> RTL
> with gimple -> LLVM IR significantly reduced the amount of memory used by
> the compiler at -O0.  I didn't investigate where the memory was going, but
> it seems likely that RTL either contains a whole lot more information than
> the LLVM IR, or doesn't represent it in a very memory efficient way.

The latter. LLVM IR contains a bit more information (or at least,
contains it in a more natural way) but the problem with RTL is, I
think, the tree-like representation. If you have an instruction like
(set (a) (b+c)) you could have, at the simples, three integers (insn
uid, basic block, instruction code) and three pointers for operands.
In total, on a 64 bits host: 3*4+3*8 = 36 bytes.

An RTL instruction of that form, assuming all operands are registers,
is 6*sizeof(struct rtx_def) = 6*48 = 288 bytes, give or take a few.
Those 6 rtx'en are for:

1. insn
2. set
3. set_dest operand
4. set_source: a plus
5. source operand 1
6. source operand 2

All in all, perhaps not the most efficient representation for memory
foot print, and the pointer chasing probably doesn't help (cache!).
But changing it is a lot more difficult than the GIMPLE tuples
project. I don't think it can be done.

Ciao!
Steven

  reply	other threads:[~2010-05-20 21:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 15:55 Steven Bosscher
2010-05-20 19:16 ` Vladimir Makarov
2010-05-20 19:57   ` Toon Moene
2010-05-20 20:36   ` Steven Bosscher
2010-05-20 20:54     ` Duncan Sands
2010-05-20 21:14       ` Steven Bosscher [this message]
2010-05-23 19:09         ` Joseph S. Myers
2010-05-24 17:00           ` Mark Mitchell
2010-05-24 21:07             ` Steven Bosscher
2010-05-24 23:22               ` Mark Mitchell
2010-05-25  1:20                 ` Joseph S. Myers
2010-05-20 21:09     ` Ian Lance Taylor
2010-05-20 21:14       ` Xinliang David Li
2010-05-20 21:18         ` Steven Bosscher
2010-05-20 21:21           ` Xinliang David Li
2010-05-21 10:54             ` Richard Guenther
2010-05-21 13:26               ` Jan Hubicka
2010-05-21 15:06                 ` Richard Guenther
2010-05-21 15:49                   ` Jan Hubicka
2010-05-21 17:06               ` Xinliang David Li
2010-05-21 17:07                 ` Richard Guenther
2010-05-20 19:36 ` Joseph S. Myers
2010-05-20 20:35 ` Eric Botcazou
2010-05-20 20:42   ` Eric Botcazou
2010-05-21 20:43 ` Diego Novillo
2010-05-20 21:28 Bradley Lucier

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=AANLkTinSYt1d8f_30Wyq4XFBIewK2e5iikPFdIPAN0r4@mail.gmail.com \
    --to=stevenb.gcc@gmail.com \
    --cc=baldrick@free.fr \
    --cc=gcc@gcc.gnu.org \
    /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).