This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Support -plugin-opt=stats-file=
ClosedPublic

Authored by arichardson on Apr 20 2022, 9:54 AM.

Details

Summary

This flag is added by clang::driver::tools::addLTOOptions() and was causing
errors for me when building the llvm-test-suite repository with LTO and
-DTEST_SUITE_COLLECT_STATS=ON. This replaces the --stats-file= option
added in 1c04b52b2594d403f739ed919ef420b1e47ae343 since the flag is only
used for LTO and should therefore be in the -plugin-opt= namespace.

Additionally, this commit fixes the REQUIRES: asserts that was added in
948d05324a150a5a24e93bad07c9090d5b8bd129: the feature was never defined in
the lld test suite so it effectively disabled the test.

Diff Detail

Event Timeline

arichardson created this revision.Apr 20 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 9:54 AM
arichardson requested review of this revision.Apr 20 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 9:54 AM
MaskRay added a subscriber: MTC.Apr 20 2022, 10:04 AM

If this is for LTO usage, I think we should remove --stats-file= recently added from D121809 (@MTC) and keep this -plugin-opt=stats-file=

If this is for LTO usage, I think we should remove --stats-file= recently added from D121809 (@MTC) and keep this -plugin-opt=stats-file=

Yes this is purely for LTO usage. I tried building the LLVM test suite with LTO+statistics and hit the unsupported flag error.

(1) Fix the typo in the subject (2) remove --stats-file= then this patch is good to go:)

Replace --stats-file and make the test actually run

arichardson retitled this revision from [ELF] Support -plugin-opt=statsfile= to [ELF] Support -plugin-opt=stats-file=.Apr 27 2022, 3:07 AM
arichardson edited the summary of this revision. (Show Details)
arichardson added a reviewer: MTC.
MTC accepted this revision.Apr 27 2022, 5:22 AM

Appreciate your fix, LGTM. I didn't notice the subtle differences between the option prefixes. Please wait for the last review from @MaskRay before landing it.

This revision is now accepted and ready to land.Apr 27 2022, 5:22 AM
MaskRay accepted this revision.Apr 27 2022, 9:49 AM

LGTM.

This revision was landed with ongoing or failed builds.May 9 2022, 8:05 AM
This revision was automatically updated to reflect the committed changes.
dyung added a subscriber: dyung.May 9 2022, 12:59 PM

@MTC @arichardson The test stats-file-option.ll that is now enabled after this commit seems to fail if X86 is not one of the built targets. Can the test be rewritten to now require that, or an appropriate REQUIRES line added?

@MTC @arichardson The test stats-file-option.ll that is now enabled after this commit seems to fail if X86 is not one of the built targets. Can the test be rewritten to now require that, or an appropriate REQUIRES line added?

This is a missing # REQUIRES: x86. The test wasn't being run before due to the asserts feature not being valid. I will commit the missing requires first thing tomorrow morning unless someone else beats me to it.