This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Truncate the context with zero probe ID
ClosedPublic

Authored by wlei on Nov 19 2021, 2:01 PM.

Details

Summary

Due to the debug info merging, there may have some contexts with zero probe id, we should truncate the context to avoid misleading pre-inliner.

Diff Detail

Event Timeline

wlei created this revision.Nov 19 2021, 2:01 PM
wlei requested review of this revision.Nov 19 2021, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 2:01 PM
wlei updated this revision to Diff 388637.Nov 19 2021, 2:50 PM

Updating D114284: [llvm-profgen] Truncate the context with zero probe ID

wlei edited the summary of this revision. (Show Details)Nov 19 2021, 3:01 PM
wlei added reviewers: hoy, wenlei.
wlei added a subscriber: spupyrev.
wlei updated this revision to Diff 388640.Nov 19 2021, 3:11 PM

Updating D114284: [llvm-profgen] Truncate the context with zero probe ID

hoy accepted this revision.Nov 19 2021, 3:39 PM

lgtm, thanks.

llvm/tools/llvm-profgen/ProfiledBinary.h
459 ↗(On Diff #388640)

nit: // clear the current context for an unknown probe

This revision is now accepted and ready to land.Nov 19 2021, 3:39 PM
wlei updated this revision to Diff 388654.Nov 19 2021, 3:43 PM

Updating D114284: [llvm-profgen] Truncate the context with zero probe ID

wenlei accepted this revision.Nov 29 2021, 8:48 PM
wenlei added inline comments.
llvm/tools/llvm-profgen/ProfileGenerator.cpp
775

Before this fix, when CalleeContextId only has one frame, what did we get for CallerProfile? A dummy root profile with empty name?

wlei updated this revision to Diff 390805.Nov 30 2021, 1:14 PM

fix lint

llvm/tools/llvm-profgen/ProfileGenerator.cpp
775

Before this fix, CalleeContextId is guaranteed to have >1 frame, see there is a check if (InlinerDesc != nullptr) to make sure the callee always has the inliner which means we only infer caller's count for inlining.

This revision was automatically updated to reflect the committed changes.