This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] llvm-profdata support for CS profile.
ClosedPublic

Authored by hoy on Mar 4 2021, 6:18 PM.

Details

Summary

Context-sensitive AutoFDO profile has a different name scheme where full calling contexts are encoded as function names. When processing CS proifle, llvm-profdata should use full contexts instead of leaf function names.

Diff Detail

Event Timeline

hoy created this revision.Mar 4 2021, 6:18 PM
hoy requested review of this revision.Mar 4 2021, 6:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2021, 6:18 PM
wenlei added inline comments.Mar 4 2021, 11:21 PM
llvm/tools/llvm-profdata/llvm-profdata.cpp
701

I see explicit hasValue() call used all over the place for Optional values, and I also feel it's more readable to spell it out instead of relying on operator(). Not sure if it's an established convention though.

hoy added inline comments.Mar 5 2021, 9:40 AM
llvm/tools/llvm-profdata/llvm-profdata.cpp
701

Not sure about the convention. There are also usages like this (using operator()) in LLVM. But agreed it's more clear with hasValue(). Will change to that.

hoy updated this revision to Diff 328562.Mar 5 2021, 9:45 AM

Addressing Wenlei's comment.

wenlei accepted this revision.Mar 5 2021, 9:47 AM

lgtm.

This revision is now accepted and ready to land.Mar 5 2021, 9:47 AM
wlei accepted this revision.Mar 5 2021, 10:14 AM

LGTM.

wmi added inline comments.Mar 5 2021, 3:31 PM
llvm/tools/llvm-profdata/llvm-profdata.cpp
1907–1910

This is not added for cs instrument fdo profile. Could you update the the description to differentiate with csspgo?

1917–1920

Is it better to update the description for csspgo since the function filter will be used as context filter? similar for value-cutoff and similarity-cutoff.

hoy added inline comments.Mar 5 2021, 5:16 PM
llvm/tools/llvm-profdata/llvm-profdata.cpp
1907–1910

Good point, the switch is for CSPGO only.

1917–1920

Sounds good. They are applied to contexts with csspgo.

hoy updated this revision to Diff 328704.Mar 5 2021, 5:17 PM

Addressing Wei's comments.

wmi accepted this revision.Mar 5 2021, 6:15 PM

LGTM.

This revision was automatically updated to reflect the committed changes.