This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Fill zero count for all function ranges
ClosedPublic

Authored by wlei on Oct 29 2021, 5:09 PM.

Details

Summary

Allow filling zero count for all the function ranges even there is no samples hitting that function. Add a switch for this.

Diff Detail

Event Timeline

wlei created this revision.Oct 29 2021, 5:09 PM
wlei requested review of this revision.Oct 29 2021, 5:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2021, 5:09 PM
wlei updated this revision to Diff 383539.Oct 29 2021, 5:12 PM

Updating D112858: [llvm-profgen] Add a switch to fill zero count for all function ranges

wlei retitled this revision from [llvm-profgen] Add a switch to fill zero count for all function ranges to [llvm-profgen] Fill zero count for all function ranges.Oct 29 2021, 5:15 PM
wlei edited the summary of this revision. (Show Details)
wlei added reviewers: hoy, wenlei, modimo.
wenlei accepted this revision.Oct 29 2021, 5:18 PM

lgtm, thanks!

This revision is now accepted and ready to land.Oct 29 2021, 5:18 PM
hoy added inline comments.Oct 29 2021, 5:24 PM
llvm/test/tools/llvm-profgen/inline-noprobe.test
7

Does it work when given an empty raw profile? Can it also work without giving a profile input? That can be a real scenario.

modimo added inline comments.Oct 29 2021, 5:28 PM
llvm/test/tools/llvm-profgen/inline-noprobe.test
7

No profile here would be great!

wenlei added inline comments.Oct 29 2021, 5:49 PM
llvm/test/tools/llvm-profgen/inline-noprobe.test
7

I think asking user to provide an (empty) profile is reasonable.. Otherwise it feels a bit stretched for llvm-profgen as a profile generation tool.

wlei updated this revision to Diff 383545.Oct 29 2021, 6:11 PM

fix typo and test

llvm/test/tools/llvm-profgen/inline-noprobe.test
7

Currently we only have PerfScriptReader and UnsymbolizedProfileReader which both need an input. To support no input profile, we might need lots of if (FillZeroForAllFuncs) else ... in validateCommandLine, PerfReader or an UnknownFileReader. Those seem make the code a little messy.

Our internal tools also require an input which can be empty(two zero on the top). What do you think?

modimo added inline comments.Oct 29 2021, 6:20 PM
llvm/test/tools/llvm-profgen/inline-noprobe.test
7

Having an empty raw profile is enough, do you mind adding a test case for it?

wlei added inline comments.Oct 29 2021, 6:28 PM
llvm/test/tools/llvm-profgen/inline-noprobe.test
7

Good point, changed the test case with only two zero input.

wlei updated this revision to Diff 383547.Oct 29 2021, 6:29 PM

add empty file test case

wlei updated this revision to Diff 383548.Oct 29 2021, 6:38 PM

update test case

hoy accepted this revision.Oct 29 2021, 6:58 PM

Lgtm, thanks.

This revision was automatically updated to reflect the committed changes.