public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rafael Espindola <espindola@google.com>
To: Chris Lattner <clattner@apple.com>
Cc: Uros Bizjak <ubizjak@gmail.com>, GCC Development <gcc@gcc.gnu.org>
Subject: Re: LLVM as a gcc plugin?
Date: Thu, 04 Jun 2009 10:14:00 -0000	[thread overview]
Message-ID: <38a0d8450906040314j143c6537y69a0547b3ee542de@mail.gmail.com> (raw)
In-Reply-To: <62149AC6-E31E-4095-98E8-FAD5416DED4A@apple.com>

> I'd love to see this, but I can't contribute to it directly.  I think the
> plugin interfaces would need small extensions, but there are no specific
> technical issues preventing it from happening.  LLVM has certainly
> progressed a lot since that (really old) email went out :)

I can help a bit.

There was some talk about it on #gcc. A plugin should be able to see
all the GCC IL, so it should be able to convert it to LLVM. Keeping
the current llvm-gcc interface would require some hacks

*) The plugin will have to call exit to keep gcc's code generation from running.
*) It will have to remove and recreate the .s file that is being
output. Not sure if this will work.
*) Gcc always produces .o files by calling the assembler, so "-c
-emit-llvm" will not work.
*) The plugis options will be of the form -fplugin-arg-llvm-emit-llvm

One way to avoid these problems is to make llvm-gcc a gcc wrapper that
runs gcc with the llvm plugin, converts command line options and in
the case of -c -emit-llvm calls llvm-as.

Another source of problem will be the early transformations that gcc
does and that are normally disabled in llvm-gcc. The one that I
remember right now is c++ thunk generation.

> -Chris
>

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047

  parent reply	other threads:[~2009-06-04 10:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04  6:30 Uros Bizjak
2009-06-04  6:39 ` Chris Lattner
2009-06-04  6:59   ` Miles Bader
2009-06-04 16:06     ` Chris Lattner
2009-06-04 10:14   ` Rafael Espindola [this message]
2009-06-04 10:21     ` Steven Bosscher
2009-06-04 10:33       ` Rafael Espindola
2009-06-04 16:12       ` Chris Lattner
2009-06-04 19:25     ` Duncan Sands
2009-06-04 20:56       ` Ian Lance Taylor
2009-06-04  7:36 ` Duncan Sands
2009-06-05  9:55 Grigori Fursin
2009-06-05 10:41 Andrew  Nisbet
2009-06-05 10:43 ` Steven Bosscher
2009-06-05 16:49   ` Chris Lattner
2009-06-05 21:06     ` Joe Buck
2009-06-08  1:10       ` Rafael Espindola
2009-06-08 10:41         ` Steven Bosscher
2009-06-08 13:28           ` Rafael Espindola

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=38a0d8450906040314j143c6537y69a0547b3ee542de@mail.gmail.com \
    --to=espindola@google.com \
    --cc=clattner@apple.com \
    --cc=gcc@gcc.gnu.org \
    --cc=ubizjak@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).