This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] LTO option for pseudo probe
ClosedPublic

Authored by hoy on Jan 20 2021, 9:21 AM.

Details

Summary

Adding a lld option to support emitting pseudo probe metadata in LTO mode.

Diff Detail

Event Timeline

hoy created this revision.Jan 20 2021, 9:21 AM
hoy requested review of this revision.Jan 20 2021, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2021, 9:21 AM
hoy updated this revision to Diff 317903.Jan 20 2021, 9:25 AM

Rebasing.

MaskRay added inline comments.Jan 20 2021, 9:30 AM
lld/ELF/Config.h
178

Omit initializer

lld/test/ELF/lto/pseudo-probe-lto.ll
2

This is not satisfied.

; REQUIRES: x86

22
; CHECK:      .section
; CHECK-NEXT:   .quad [[#GUID]]
33

can some metadata be simplified?

hoy marked 4 inline comments as done.Jan 20 2021, 10:08 AM
hoy added inline comments.
lld/test/ELF/lto/pseudo-probe-lto.ll
33

Yes. I'll reduce unnecessary debug data.

hoy updated this revision to Diff 317921.Jan 20 2021, 10:08 AM
hoy marked an inline comment as done.

Addressing MaskRay's feedbacks.

wmi added inline comments.Jan 21 2021, 7:30 PM
lld/test/ELF/lto/pseudo-probe-lto.ll
4

Add the check for the alias option plugin-opt=pseudo-probe-for-profiling?

hoy marked an inline comment as done.Jan 21 2021, 9:42 PM
hoy added inline comments.
lld/test/ELF/lto/pseudo-probe-lto.ll
4

Sounds good.

hoy updated this revision to Diff 318415.Jan 21 2021, 9:42 PM
hoy marked an inline comment as done.

Addressing Wei's feedback.

wenlei added inline comments.Jan 21 2021, 10:19 PM
lld/ELF/Options.td
554

nit: Encode -> Emit? the clang driver help messages says "Emit pseudo probes for sample profiler", would be good change to "profiling" there too.

hoy added inline comments.Jan 21 2021, 10:27 PM
lld/ELF/Options.td
554

Good catch, changed Encode and profiling.

hoy updated this revision to Diff 318419.Jan 21 2021, 10:27 PM

Addressing Wenlei's feedback.

wenlei accepted this revision.Jan 21 2021, 10:33 PM

lgtm with minor comment.

lld/ELF/Options.td
554

I actually meant to suggest both lld and clang driver use "Emit pseudo probes for sample profiling", the switch name uses profiling.

This revision is now accepted and ready to land.Jan 21 2021, 10:33 PM
hoy updated this revision to Diff 318425.Jan 21 2021, 10:46 PM

Changing help message for the switch.

wmi accepted this revision.Jan 22 2021, 9:24 AM

LGTM.

MaskRay added inline comments.Jan 22 2021, 9:30 AM
lld/ELF/Options.td
554

Drop period

629

- -> --

MaskRay requested changes to this revision.Jan 22 2021, 9:30 AM
This revision now requires changes to proceed.Jan 22 2021, 9:30 AM
hoy updated this revision to Diff 318583.Jan 22 2021, 10:58 AM

Addressing MaskRay's feedbacks.

hoy marked 2 inline comments as done.Jan 22 2021, 10:59 AM
MaskRay accepted this revision.Jan 22 2021, 11:04 AM

Thanks!

This revision is now accepted and ready to land.Jan 22 2021, 11:04 AM
This revision was landed with ongoing or failed builds.Jan 22 2021, 11:07 AM
This revision was automatically updated to reflect the committed changes.