This is an archive of the discontinued LLVM Phabricator instance.

[Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options
AbandonedPublic

Authored by Amir on Feb 8 2023, 5:48 PM.

Details

Reviewers
beanz
phosek
jobnoorman
Group Reviewers
Restricted Project
Summary

Split up and refactor CLANG_BOLT_INSTRUMENT into support for
perf no-LBR and perf with LBR profiling modes.

Diff Detail

Event Timeline

Amir created this revision.Feb 8 2023, 5:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 5:48 PM
Amir requested review of this revision.Feb 8 2023, 5:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 5:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Amir updated this revision to Diff 496249.Feb 9 2023, 2:59 PM

Add perf and perf+LBR support

Amir retitled this revision from [Clang][CMake] Break out Instrument from CLANG_BOLT option to [Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options.Feb 9 2023, 3:00 PM
Amir edited the summary of this revision. (Show Details)
Amir updated this revision to Diff 496253.Feb 9 2023, 3:13 PM

Reduce changes

Amir updated this revision to Diff 496271.Feb 9 2023, 3:57 PM

Reduce changes

Amir updated this revision to Diff 496272.Feb 9 2023, 3:59 PM

Reduce changes

Amir updated this revision to Diff 496273.Feb 9 2023, 4:00 PM

Reduce changes

Amir updated this revision to Diff 496276.Feb 9 2023, 4:23 PM

Reduce changes

Amir updated this revision to Diff 538271.Jul 7 2023, 2:36 PM

Rebase + reformatted with black (D150761)

phosek added inline comments.Jul 19 2023, 1:50 AM
clang/utils/perf-training/bolt.lit.cfg
12

This name would ideally be passed through the generated lit.site.cfg rather than hardcoding it here.

clang/utils/perf-training/perf-helper.py
64

This could be omitted.

74

Can we remove this?

77–86

Why not assign to perf_args directly?

104

I'd call it llvm-bolt for simplicity.

107–109

I'd consider providing both --lbr and --no-lbr options.

112–115

Why not assign to p2b_args directly?

Amir updated this revision to Diff 542060.Jul 19 2023, 9:11 AM

Address comments

Amir marked 7 inline comments as done.Jul 19 2023, 10:05 AM
Amir added inline comments.
clang/utils/perf-training/perf-helper.py
64

I think it's best to keep it as optional argument, not positional.

Amir updated this revision to Diff 542264.Jul 19 2023, 5:46 PM
Amir marked an inline comment as done.

Fix instrumentation mode

Amir updated this revision to Diff 542272.Jul 19 2023, 7:10 PM

Set CLANG_BOLT_INSTRUMENTED in parent scope too.

Amir updated this revision to Diff 542280.Jul 19 2023, 7:41 PM

Make the name of BOLT-instrumented Clang binary (CLANG_BOLT_INSTRUMENTED)
a user-settable cache variable