Page MenuHomePhabricator

[ThinLTOCodeGenerator] Add support for index-based WPD
ClosedPublic

Authored by evgeny777 on Oct 14 2019, 11:30 AM.

Diff Detail

Event Timeline

evgeny777 created this revision.Oct 14 2019, 11:30 AM

Thanks for working on this. Comments inline.

lib/LTO/ThinLTOCodeGenerator.cpp
583 ↗(On Diff #224882)

I know this struct is callable but IsExported feels like a weird name for stuck. Maybe something like ExportedSymbolChecker?

Same for IsPrevailing.

849 ↗(On Diff #224882)

Should we add indexed-based WPD into optimized as well? So we can add a unit test using optimize, rather than run. You can add a flag to llvm-lto to determine if WPD is enabled.

Should we add indexed-based WPD into optimized as well?

The problem is where we would get summary with WPD resolutions in such case. The only place where combined index is saved is linkCombinedIndex but
it lacks information about exported symbols and it's not possible to devirtualize without it.

Extending linkCombinedIndex, so that --exported-symbol can be used in conjunction with --thinlto-action=thinlink can probably fix the issue.
The next step after that is probably to strip --exported-symbol flag from import and promote actions as combined index would be finalized after thin link is over.

steven_wu accepted this revision.Oct 17 2019, 1:37 PM

Sounds like a good plan going forward.

This revision is now accepted and ready to land.Oct 17 2019, 1:37 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2019, 3:55 AM