This is an archive of the discontinued LLVM Phabricator instance.

llvm-lto support for generating combined function indexes
ClosedPublic

Authored by tejohnson on Oct 17 2015, 8:21 AM.

Details

Summary

This patch adds support to llvm-lto that mirrors the support added by
r249270 to the gold plugin. This enables better testing of combined
index generation for ThinLTO.

Added a new test, and this support will be used in the test in D13515.

Note that the support directly uses lib/Object interfaces, since there
are no lib/LTO interfaces for function indexes (yet). This is similar to
gold which no longer uses lib/LTO interfaces. In order to add lto.h/.cpp
interfaces for function indexes (for linkers other than gold), is it
necessary to add lib/LTO support for function indexes, or can the lto
interfaces use lib/Object directly as gold does? Depending on the answer
to that I may want to add lib/LTO support as part of this patch and
use that in llvm-lto.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 37682.Oct 17 2015, 8:21 AM
tejohnson retitled this revision from to llvm-lto support for generating combined function indexes.
tejohnson updated this object.
tejohnson added a subscriber: llvm-commits.
mehdi_amini accepted this revision.Oct 18 2015, 10:27 PM
mehdi_amini edited edge metadata.

LGTM (modulo a few minor comments).

test/tools/llvm-lto/thinlto.ll
1 ↗(On Diff #37682)

Can you put a comment a the top of the file saying what's the point of this test?

tools/llvm-lto/llvm-lto.cpp
183 ↗(On Diff #37682)

I believe we have autobrief and you can leave the \brief tag out.

189 ↗(On Diff #37682)

?

190 ↗(On Diff #37682)

Could a local variable be enough?

This revision is now accepted and ready to land.Oct 18 2015, 10:27 PM
tejohnson marked 2 inline comments as done.Oct 19 2015, 7:30 AM

Thanks for the review. Responses below, will commit fixed patch.

tools/llvm-lto/llvm-lto.cpp
189 ↗(On Diff #37682)

Cleaned up.

190 ↗(On Diff #37682)

Changed CombinedIndex to a local. This was copied out of my gold-plugin code which I will cleanup similarly in a follow-on commit.

This revision was automatically updated to reflect the committed changes.