[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)

Teresa Johnson tejohnson at google.com
Thu Jun 4 17:17:16 PDT 2015


On Thu, Jun 4, 2015 at 5:02 PM, Duncan P. N. Exon Smith
<dexonsmith at apple.com> wrote:
>
>> On 2015 Jun 4, at 16:51, Reid Kleckner <rnk at google.com> wrote:
>>
>> On Thu, Jun 4, 2015 at 3:58 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> > Personally, I think the right approach is to add a bool to createGlobalDCEPass defaulting to true named something like IsAfterInlining. In most standard pass pipelines, GlobalDCE runs after inlining for obvious reasons, so the default makes sense. The special case is the LTO pass pipeline, where the code will be reloaded and reoptimized later. IMO it's natural to put the customization there.
>>
>> That's a good point.  But I still like these as separate passes.
>>
>> Hm, yeah, that's pretty sane. So, add a pass to downgrade available_externally global definitions to declarations with external linkage, add it to the standard -O2 pass pipeline, ensure that it's not part of LTO, and then call it done?
>
> SGTM.

Agreed. Although I assume you mean invoke the new pass under a
ThinLTO-only option so that avail extern are not dropped in the
compile pass before the LTO link?

Teresa

-- 
Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413




More information about the llvm-dev mailing list