This is an archive of the discontinued LLVM Phabricator instance.

[ELF] --reproduce should include lto sample profile
ClosedPublic

Authored by christylee on Jul 24 2020, 5:19 PM.

Diff Detail

Event Timeline

christylee created this revision.Jul 24 2020, 5:19 PM

Removed debug comment.

christylee marked an inline comment as done.
christylee added inline comments.
lld/ELF/Driver.cpp
499

At this point config->ltoSampleProfile hasn't been initialized yet so we have to read in the argument value. However, this seems like the most logical place to append extra stuff to the link repro tar.

MaskRay added inline comments.Jul 24 2020, 5:32 PM
lld/test/ELF/reproduce.s
8

Add the test to reproduce-lto.s

Moved test case to reproduce-lto.s

MaskRay added inline comments.Jul 24 2020, 7:18 PM
lld/ELF/Driver.cpp
507

Just move this line above so that we can use config->ltoSampleProfile

lld/test/ELF/reproduce-lto.s
5 ↗(On Diff #280645)

-triple=x86_64

6 ↗(On Diff #280645)

echo > %t.dir/build1/empty_profile.txt

8 ↗(On Diff #280645)

Delete --hash-style=gnu

Use -o /dev/null

christylee marked an inline comment as done.Jul 27 2020, 8:59 AM
christylee added inline comments.
lld/ELF/Driver.cpp
507

If we move config->ltoSampleProfile up to before getReproduceOptions(args), then symbol ordering file, dynamic list, and version script will be consumed before the tar object is created, so they won't be included in the repro.tar. Would it be better if I move this to where we parse LTO options?

MaskRay accepted this revision.Jul 27 2020, 9:10 AM

LGTM.

This revision is now accepted and ready to land.Jul 27 2020, 9:10 AM

Addressed comments, fixed unittest.

This revision was automatically updated to reflect the committed changes.
wenlei added a subscriber: wenlei.Jul 28 2020, 9:52 AM

Committed on behalf of @christylee while she tries to recover commit access.