This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Use probe inline tree to track zero size fully optimized context for pre-inliner
ClosedPublic

Authored by wenlei on Aug 18 2021, 9:15 PM.

Details

Summary

This is a follow up diff for BinarySizeContextTracker to track zero size for fully optimized inlinee. When an inlinee is fully optimized away, we won't be able to get its size through symbolizing instructions, hence we will treat the corresponding context size as unknown. However by traversing the inlined probe forest, we know what're original inlinees regardless of optimization. If a context show up in inlined probes, but not during symbolization, we know that it's fully optimized away hence its size is zero instead of unknown. It should provide more accurate size cost estimation for pre-inliner to make better inline decisions in llvm-profgen.

Diff Detail

Event Timeline

wenlei created this revision.Aug 18 2021, 9:15 PM
wenlei requested review of this revision.Aug 18 2021, 9:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2021, 9:15 PM
hoy added inline comments.Aug 23 2021, 9:36 AM
llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
84

Use Optional for this field?

wenlei added inline comments.Aug 24 2021, 5:07 PM
llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
84

Sounds good, changed.

wenlei updated this revision to Diff 368500.Aug 24 2021, 5:07 PM

Address comments

hoy accepted this revision.Aug 24 2021, 5:32 PM

lgtm

This revision is now accepted and ready to land.Aug 24 2021, 5:32 PM
wmi accepted this revision.Aug 25 2021, 8:45 AM

LGTM.

llvm/tools/llvm-profgen/ProfiledBinary.h
123

trackOptimizedInlinees --> trackInlineesOptimizedAway?

wenlei added inline comments.Aug 25 2021, 8:52 AM
llvm/tools/llvm-profgen/ProfiledBinary.h
123

Sounds good, renamed.

This revision was landed with ongoing or failed builds.Aug 25 2021, 9:01 AM
This revision was automatically updated to reflect the committed changes.