This is an archive of the discontinued LLVM Phabricator instance.

[Pseudo Probe] Use the name from debug info to compute GUID in probe desc
ClosedPublic

Authored by wlei on Mar 22 2023, 1:17 PM.

Details

Summary

This is to fix a GUID mismatch while decoding pseudo probe, a GUID from the inline tree is not in the GUID2FuncDescMap. It turned out that frontend could change the function name making it different from the one in debug info(https://reviews.llvm.org/D111009). Here change to use the function name from debug info to be consistent with the probe name from the inline stack.

Diff Detail

Event Timeline

wlei created this revision.Mar 22 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 1:17 PM
wlei requested review of this revision.Mar 22 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 1:17 PM
wlei retitled this revision from [Pseudo Probe] use the name from debug info to compute probe GUID to [Pseudo Probe] Use the name from debug info to compute GUID in probe desc.Mar 22 2023, 1:26 PM
wlei edited the summary of this revision. (Show Details)
wlei added reviewers: hoy, wenlei.
hoy accepted this revision.Mar 22 2023, 2:52 PM

Good catch, thanks for the fix.

This revision is now accepted and ready to land.Mar 22 2023, 2:52 PM
hoy added inline comments.Mar 22 2023, 2:55 PM
llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
381

The dwarf name should also be used inside this function.

wlei updated this revision to Diff 507523.Mar 22 2023, 3:15 PM
wlei edited the summary of this revision. (Show Details)

fix another func name usage.

Is the patch mentioned above the only case where name from IR would be different from name in debug info? Just want to make sure this change doesn't have any compatibility issue while fixing the mismatch from the patch.

wlei added a comment.Mar 22 2023, 7:50 PM

Is the patch mentioned above the only case where name from IR would be different from name in debug info? Just want to make sure this change doesn't have any compatibility issue while fixing the mismatch from the patch.

Yes, from our internal issue, I dumped all the mismatched GUID function names, they are memcpy.inline, memset.inline, memmove.inline. Interesting, assuming this is the first time we got this mismatch, that means before the frontend all generated a consistent symbol and dwarf name.

wenlei accepted this revision.Mar 22 2023, 7:57 PM

lgtm, thanks.