This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Set PseudoProbeInserter as a default pass.
ClosedPublic

Authored by hoy on Sep 21 2021, 5:17 PM.

Details

Summary

Currenlty PseudoProbeInserter is a pass conditioned on a target switch. It works well with a single clang invocation. It doesn't work so well when the backend is called separately (i.e, through the linker or llc), where user has always to pass -pseudo-probe-for-profiling explictly. I'm making the pass a default pass that requires no command line arg to trigger, but will be actually run depending on whether the CU comes with llvm.pseudo_probe_desc metadata.

Diff Detail

Event Timeline

hoy created this revision.Sep 21 2021, 5:17 PM
hoy requested review of this revision.Sep 21 2021, 5:17 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 21 2021, 5:17 PM
wenlei accepted this revision.Sep 21 2021, 5:23 PM

thanks for the change. control this through metadata is more reliable than through LTO time flags. Scheduling a non-op pass shouldn't incur overhead either. lgtm.

This revision is now accepted and ready to land.Sep 21 2021, 5:23 PM

lld/test/ELF/lto/pseudo-probe-lto.ll needs update

hoy added a comment.Sep 21 2021, 11:07 PM

lld/test/ELF/lto/pseudo-probe-lto.ll needs update

Good catch, thanks.

I also moved the pass into x86 backend only, as there are a lot test failures on other targets and we don't really need the pass there..

hoy updated this revision to Diff 374126.Sep 21 2021, 11:08 PM

Updating D110209: [CSSPGO] Set PseudoProbeInserter as a default pass.

This revision was landed with ongoing or failed builds.Sep 22 2021, 9:10 AM
This revision was automatically updated to reflect the committed changes.