public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uday Khedker <uday@cse.iitb.ac.in>
To: Renato Golin <renato.golin@linaro.org>, Jan Hubicka <hubicka@ucw.cz>
Cc: gcc <gcc@gcc.gnu.org>, Chandler Carruth <chandlerc@google.com>
Subject: Re: Fwd: LLVM collaboration?
Date: Tue, 11 Feb 2014 10:03:00 -0000	[thread overview]
Message-ID: <52F9F52E.50409@cse.iitb.ac.in> (raw)
In-Reply-To: <CAMSE1kdp5RQhsLTAYpshBvOrYVBY=9Y_hZDq6cNQk837a88cbA@mail.gmail.com>





On Tuesday 11 February 2014 03:25 PM, Renato Golin wrote:
> Hi Jan,
>
> I think this is a very good example where we could all collaborate
> (including binutils).
>
> I'll leave your reply intact, so that Chandler (CC'd) can get a bit
> more context. I'm copying him because he (and I believe Diego) had
> more contact with LTO than I had.
>
> If I got it right, LTO today:
>
> - needs the drivers to explicitly declare the plugin
> - needs the library available somewhere
> - may have to change the library loading semantics (via LD_PRELOAD)

There is another need that I have felt in LTO for quite some time. 
Currently, it has a non-partitioned mode or a partitioned mode but this 
decision is taken before the compilation begins. It would be nice to 
have a mode that allows dynamic loading of function bodies so that a 
flow and context sensitive IPA could load functions bodies on demand, 
and unload them when they are not needed.

Uday.

>
> Since both toolchains do the magic, binutils has no incentive to
> create any automatic detection of objects.
>
> The part that I didn't get is when you say about backward
> compatibility. Would LTO work on a newer binutils with the liblto but
> on an older compiler that knew nothing about LTO?
>
> Your proposal is, then, to get binutils:
>
> - recognizing LTO logic in the objects
> - automatically loading liblto if recognized
> - warning if not
>
> I'm assuming the extra symbols would be discarded if no library is
> found, together with the warning, right? Maybe an error if -Wall or
> whatever.
>
> Can we get someone from the binutils community to opine on that?
>
> cheers,
> --renato
>
> On 11 February 2014 02:29, Jan Hubicka <hubicka@ucw.cz> wrote:
>> One practical experience I have with LLVM developers is sharing experiences
>> about getting Firefox to work with LTO with Rafael Espindola and I think it was
>> useful for both of us. I am definitly open to more discussion.
>>
>> Lets try a specific topic that is on my TODO list for some time.
>>
>> I would like to make it possible for mutliple compilers to be used to LTO a
>> single binary. As we are all making LTO more useful, I think it is matter of
>> time until people will start shipping LTO object files by default and users
>> will end up feeding them into different compilers or incompatible version of
>> the same compiler. We probably want to make this work, even thought the
>> cross-module optimization will not happen in this case.
>>
>> The plugin interface in binutils seems to do its job well both for GCC and LLVM
>> and I hope that open64 and ICC will eventually join, too.
>>
>> The trouble however is that one needs to pass explicit --plugin argument
>> specifying the particular plugin to load and so GCC ships with its own wrappers
>> (gcc-nm/gcc-ld/gcc-ar and the gcc driver itself) while LLVM does similar thing.
>>
>> It may be smoother if binutils was able to load multiple plugins at once and
>> grab plugins from system and user installed compilers without explicit --plugin
>> argument.
>>
>> Binutils probably should also have a way to detect LTO object files and produce
>> more useful diagnostic than they do now, when there is no plugin claiming them.
>>
>> There are some PRs filled on the topic
>> http://cygwin.com/frysk/bugzilla/show_bug.cgi?id=15300
>> http://cygwin.com/frysk/bugzilla/show_bug.cgi?id=13227
>> but not much progress on them.
>>
>> I wonder if we can get this designed and implemented.
>>
>> On the other hand, GCC current maintains non-plugin path for LTO that is now
>> only used by darwin port due to lack of plugin enabled LD there.  It seems
>> that liblto used by darwin is losely compatible with the plugin API, but it makes
>> it harder to have different compilers share it (one has to LD_PRELOAD liblto
>> to different one prior executing the linker?)
>>
>> I wonder, is there chance to implement linker plugin API to libLTO glue or add
>> plugin support to native Darwin tools?
>>
>> Honza

  reply	other threads:[~2014-02-11 10:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMSE1kdfpeLp6NEc+jnEWqi0KWV-+=Q701UsiLhgcn13X6fYcA@mail.gmail.com>
2014-02-07 21:34 ` Renato Golin
2014-02-07 21:53   ` Diego Novillo
2014-02-07 22:07     ` Renato Golin
2014-02-07 22:33       ` Andrew Pinski
2014-02-07 22:35         ` Renato Golin
2014-02-10 14:48       ` Diego Novillo
2014-02-07 22:28     ` Andrew Pinski
2014-02-07 22:23   ` Andrew Pinski
2014-02-07 22:42   ` Jonathan Wakely
2014-02-07 23:12     ` Renato Golin
2014-02-07 23:30   ` Fwd: " Joseph S. Myers
2014-02-07 23:59     ` Renato Golin
2014-02-11  2:29   ` Jan Hubicka
2014-02-11  9:55     ` Renato Golin
2014-02-11 10:03       ` Uday Khedker [this message]
2014-02-11 16:00         ` Jan Hubicka
2014-02-11 16:07           ` Uday Khedker
2014-02-11 16:18           ` Renato Golin
2014-02-11 17:29       ` Renato Golin
2014-02-11 18:02         ` Rafael Espíndola
2014-02-11 18:51           ` Markus Trippelsdorf
2014-02-11 20:52             ` Jan Hubicka
2014-02-11 21:20           ` Jan Hubicka
2014-02-11 21:38             ` Rafael Espíndola
2014-02-11 22:36               ` Hal Finkel
2014-09-17 21:41                 ` Hal Finkel
2014-02-12 11:10             ` Fwd: " Richard Biener
2014-02-12 13:15               ` Rafael Espíndola
2014-02-12 16:19               ` Joseph S. Myers
2014-02-12 16:23                 ` Jan Hubicka
2014-02-13  9:06                   ` 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=52F9F52E.50409@cse.iitb.ac.in \
    --to=uday@cse.iitb.ac.in \
    --cc=chandlerc@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=renato.golin@linaro.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).