This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen][NFC] Fix the incorrect computation of callsite sample count
ClosedPublic

Authored by wlei on Jan 19 2021, 4:20 PM.

Details

Summary

For branch sample, we don't need add total sample count since it's included in the range sample.

For the inferred sample count, we should accumulate its caller's body sample count.

Diff Detail

Event Timeline

wlei created this revision.Jan 19 2021, 4:20 PM
wlei requested review of this revision.Jan 19 2021, 4:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 4:20 PM
wlei edited the summary of this revision. (Show Details)Jan 19 2021, 4:26 PM
wlei added reviewers: hoy, wenlei, wmi, davidxl.
hoy added inline comments.Jan 19 2021, 4:56 PM
llvm/tools/llvm-profgen/ProfileGenerator.cpp
278

What is this check?

wlei added inline comments.Jan 19 2021, 5:01 PM
llvm/tools/llvm-profgen/ProfileGenerator.cpp
278

Good catch! This is to filter the invalid negative LineOffset same as updateBodySamplesforFunctionProfile. but I think here it's only for the inferred context, shouldn't have the negative line. I will remove this.

wlei updated this revision to Diff 317732.Jan 19 2021, 5:33 PM
wlei edited the summary of this revision. (Show Details)

remove updateBodySamplesforFunctionProfile and redundant check

wenlei accepted this revision.Jan 19 2021, 5:35 PM

lgtm, thanks!

This revision is now accepted and ready to land.Jan 19 2021, 5:35 PM
hoy accepted this revision.Jan 19 2021, 5:49 PM
This revision was landed with ongoing or failed builds.Jan 19 2021, 6:11 PM
This revision was automatically updated to reflect the committed changes.