This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Do not use getCanonicalFnName in pseudo probe descriptor decoding
ClosedPublic

Authored by hoy on Aug 10 2021, 8:59 AM.

Details

Summary

Pseudo probe descriptors are created very early in the pipeline where function names just come from the front end and are not yet decorated. So calling getCanonicalFnName on the function names in probe desc is basically a no-op, which also addes a depenency from MC to ProfileData unnessesarily.

Diff Detail

Event Timeline

hoy created this revision.Aug 10 2021, 8:59 AM
hoy requested review of this revision.Aug 10 2021, 8:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2021, 8:59 AM
hoy added a subscriber: JamesNagurne.
hoy updated this revision to Diff 365500.Aug 10 2021, 9:06 AM

Rebasing

wlei accepted this revision.Aug 10 2021, 10:26 AM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 10 2021, 10:26 AM
wenlei added inline comments.Aug 10 2021, 4:23 PM
llvm/lib/MC/MCPseudoProbe.cpp
360

does this have __uniq.? Can we assert it does not contain .?

hoy added inline comments.Aug 10 2021, 4:34 PM
llvm/lib/MC/MCPseudoProbe.cpp
360

It can have that since the uniq suffx is from the frontend. We can assert it doesn't have .llvm etc...

wenlei accepted this revision.Aug 10 2021, 4:37 PM

lgtm, thanks.

llvm/lib/MC/MCPseudoProbe.cpp
360

ok, as long as it's verified to be no-op now, the risk of something breaking this is low. I think it's fine to leave it as is too.

This revision was landed with ongoing or failed builds.Aug 10 2021, 6:27 PM
This revision was automatically updated to reflect the committed changes.

This change introduced a race condition in the build and we saw it fail in our private buildbots on both Ubuntu and Windows because of a dependency on Attributes.inc (the target intrinsics_gen) which had previously been covered by the ProfileData library. I haven't confirmed whether https://reviews.llvm.org/rG68d6c3e4486c6743dfa419ec0d919d8e97fdad05 removed that dependency by removing the header from ProfileData, though it likely does, so I wanted to leave a note here for anyone else who runs into this - or if it recurs.

hoy added a comment.Aug 11 2021, 9:38 AM

This change introduced a race condition in the build and we saw it fail in our private buildbots on both Ubuntu and Windows because of a dependency on Attributes.inc (the target intrinsics_gen) which had previously been covered by the ProfileData library. I haven't confirmed whether https://reviews.llvm.org/rG68d6c3e4486c6743dfa419ec0d919d8e97fdad05 removed that dependency by removing the header from ProfileData, though it likely does, so I wanted to leave a note here for anyone else who runs into this - or if it recurs.

Thanks for letting me know. As you pointed out, https://reviews.llvm.org/rG68d6c3e4486c6743dfa419ec0d919d8e97fdad05 should fix the issue.