This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Filter out oversized LBR ranges.
AbandonedPublic

Authored by hoy on Apr 7 2022, 11:44 PM.

Details

Reviewers
wenlei
wlei
Summary

As a follow up to D123271: [llvm-profgen] Filter out invalid LBR ranges., LBR ranges that are too big should also be considered as invalid.

For example, the last two pairs in the following trace form a range [0x0d7b02b0, 0x368ba706] that covers a ton of functions in the binary. Such oversized range should also be ignored.

0x0c74505f/0x368b99a0 **0x368ba706**/0x0c745040  0x0d7b1c3f/**0x0d7b02b0**

I'm using the size of the largest binary function range to define an oversized range, since there cannot be a linear execution range that spans over multiple function ranges.

Diff Detail

Event Timeline

hoy created this revision.Apr 7 2022, 11:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 11:44 PM
Herald added subscribers: modimo, wenlei. · View Herald Transcript
hoy requested review of this revision.Apr 7 2022, 11:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 11:44 PM
hoy edited the summary of this revision. (Show Details)Apr 7 2022, 11:50 PM
hoy added reviewers: wenlei, wlei.
wenlei added inline comments.Apr 8 2022, 10:31 AM
llvm/tools/llvm-profgen/PerfReader.h
218

While it has value to have such defensive checks in the tool, I'm wondering what has caused such bad input.

The range check seems hacky. If we have to go with it, we at least need some explanation why it's needed, and call out in comment that this is a workaround.

hoy abandoned this revision.Apr 28 2022, 11:33 AM

We don't seem to need this change at this point.

hoy updated this revision to Diff 428791.May 11 2022, 3:35 PM

Updating D123361: [llvm-profgen] Filter out oversized LBR ranges.

hoy edited the summary of this revision. (Show Details)May 11 2022, 3:37 PM