[llvm] r188188 - Misc enhancements to LTO:

Nick Lewycky nlewycky at google.com
Mon Aug 12 13:03:02 PDT 2013


On 12 August 2013 12:22, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

> On 8/12/13 12:16 PM, Nick Lewycky wrote:
>
>> Shuxin Yang wrote:
>>
>>> Author: shuxin_yang
>>> Date: Mon Aug 12 13:29:43 2013
>>> New Revision: 188188
>>>
>>> URL: http://llvm.org/viewvc/llvm-**project?rev=188188&view=rev<http://llvm.org/viewvc/llvm-project?rev=188188&view=rev>
>>> Log:
>>> Misc enhancements to LTO:
>>>
>>>    1. Add some helper classes for partitions. They are designed in a
>>>       way such that the top-level LTO driver will not see much difference
>>>       with or without partitioning.
>>>
>>>    2. Introduce work-dir. Now all intermediate files generated during
>>>       LTO phases will be saved under work-dir. User can specify the
>>> workdir
>>>       via -lto-workdir=/path/to/dir. By default the work-dir will be
>>>       erased before linker exit. To keep the workdir, do -lto-keep, or
>>> -lto-keep=1.
>>>
>>>      TODO: Erase the workdir, if the linker exit prematurely.
>>>        We are currently not able to remove directory on signal. The
>>> support
>>>        routines simply ignore directory.
>>>
>>>    3. Add one new API lto_codegen_get_files_need_**remove().
>>>       Linker and LTO plugin will communicate via this API about which
>>> files
>>>      (including directories) need to removed before linker exit.
>>>
>>
>> Please revert. Adding new flags to libLTO is the wrong direction (in
>> spite of the ones that exist -- consider those grandfathered in).
>>
> It dose not make sense. Without flags, how do you manage to triage the
> correctness and performance problem?
>

Something else has flags, which in turn drives libLTO through the API.


> Adding flags to linker instead, I think that is wrong direction. Linker
> dose not have data structure which libLTO dose.


This is the discussion to have. What things do you need here which you
don't think should be exposed through the API, and yet you want to be
exposed for you?

libLTO is intended to be used as a library, it may not get a chance to
> parse flags.
> It has to. Prior to my change, linkers (GNU linker and Apple ld) pass arch
> to linker, via a function
> confusingly called, something like "add.*debug.*options".


Can't. If we allow this, every flag in every part of LLVM that libLTO links
against is baked into the C ABI forever.

Of course addDebugOptions does allow this, but it's named (and I thought
documented in the comments) such that anybody using it knows they're using
a non-stable non-production debugging API. Anybody using addDebugOptions
for something other than debugging libLTO is living outside the ABI
guarantees.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130812/d0e0afe0/attachment.html>


More information about the llvm-commits mailing list