Page MenuHomePhabricator

[LTO][ELF] Add --stats-file= option.
ClosedPublic

Authored by MTC on Mar 16 2022, 7:58 AM.

Details

Summary

This patch adds a StatsFile option supported by gold to lld, related patch https://reviews.llvm.org/D45531.

Diff Detail

Event Timeline

MTC created this revision.Mar 16 2022, 7:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 7:58 AM
MTC requested review of this revision.Mar 16 2022, 7:58 AM
tejohnson accepted this revision.Mar 16 2022, 8:51 AM

lgtm. Few minor comments to address below before submitting.

lld/ELF/LTO.cpp
145

nit: s/Setup/Set up/

lld/test/ELF/lto/stats-file-option.ll
4

Nit: I believe the new convention in this test directory at least is to prefix comments with two semicolons.

5

nit: looks like no need to split this command into 2 lines to fit into 80 chars

This revision is now accepted and ready to land.Mar 16 2022, 8:51 AM
MaskRay accepted this revision.EditedMar 16 2022, 9:51 AM

([lld] may be thought of applying to all lld ports: COFF, ELF, MachO, wasm. I usually use [ELF] to indicate ELF specific changes).

stats-file option => --stats-file=

lld/test/ELF/lto/stats-file-option.ll
16
MTC updated this revision to Diff 416028.Mar 16 2022, 5:12 PM
MTC retitled this revision from [LTO][lld] Add stats-file option. to [LTO][ELF] Add --stats-file= option..

NFC, improve the comments and the test.

MTC marked 4 inline comments as done.Mar 16 2022, 5:14 PM

Thanks for all the kind comments, I have updated the patch.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 9:01 PM
MTC added a comment.EditedMar 16 2022, 10:24 PM

Sorry to interrupt, seems this patch caused the build failure, see https://lab.llvm.org/buildbot/#/builders/124/builds/3944. I don't have any clue why this failed, Did I miss something for the test file? Like ; REQUIRES: x86 is indispensable?

Sorry to interrupt, seems this patch caused the build failure, see https://lab.llvm.org/buildbot/#/builders/124/builds/3944. I don't have any clue why this failed, Did I miss something for the test file? Like ; REQUIRES: x86 is indispensable?

Ah, for stats printing I believe you need a "REQUIRES: asserts"

MTC added a comment.Mar 16 2022, 11:54 PM

Sorry to interrupt, seems this patch caused the build failure, see https://lab.llvm.org/buildbot/#/builders/124/builds/3944. I don't have any clue why this failed, Did I miss something for the test file? Like ; REQUIRES: x86 is indispensable?

Ah, for stats printing I believe you need a "REQUIRES: asserts"

Very much appreciate your help, I will dig into it so as not to screw things up.