Page MenuHomePhabricator

[HotColdSplitting] Allow outlining single-block cold regions
ClosedPublic

Authored by vsk on Oct 29 2018, 11:52 AM.

Details

Summary

It can be profitable to outline single-block cold regions because they
may be large.

Allow outlining single-block regions if they have over some threshold of
non-debug, non-terminator instructions. I chose 3 as the threshold after
experimenting with several internal frameworks.

In practice, reducing the threshold further did not give much
improvement, whereas increasing it resulted in substantial regressions.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Oct 29 2018, 11:52 AM
sebpop accepted this revision.Oct 29 2018, 12:02 PM

Ok, thanks!

This revision is now accepted and ready to land.Oct 29 2018, 12:02 PM
This revision was automatically updated to reflect the committed changes.
junbuml added inline comments.
llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp
145

Don't you think using TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize) is the right thing to do instead of counting the number of instruction?

245

Why don't you use MinOutliningInstCount directly in hasMinimumInstCount() instead of passing as a parameter?

vsk added inline comments.Oct 29 2018, 2:01 PM
llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp
145

Thanks for suggesting this. I'll try this out and report back (with a patch if all goes well).

245

Good point, I'll address this in a follow-up.