[cfe-dev] [llvm-dev] [RFC] New Feature Proposal: De-Optimizing Cold Functions using PGO Info

Min-Yih Hsu via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 9 09:42:51 PDT 2020


Hi Renato,

On Wed, Sep 9, 2020 at 1:03 AM Renato Golin <rengolin at gmail.com> wrote:

> On Wed, 9 Sep 2020 at 01:21, Min-Yih Hsu via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> From the above experiments we observed that compilation / link time
>> improvement scaled linearly with the percentage of cold functions we
>> skipped. Even if we only skipped functions that never got executed (i.e.
>> had counter values equal to zero, which is effectively “0%”), we already
>> had 5~10% of “free ride” on compilation / linking speed improvement and
>> barely had any target performance penalty.
>>
>
> Hi Min (Paul, Edd),
>
> This is great work! Small, clear patch, substantial impact, virtually no
> downsides.
>

Thank you :-)

>
> Just looking at your test-suite numbers, not optimising functions "never
> used" during the profile run sounds like an obvious "default PGO behaviour"
> to me. The flag defining the percentage range is a good option for
> development builds.
>

> I imagine you guys have run this on internal programs and found
> beneficial, too, not just the LLVM test-suite (which is very small and
> non-representative). It would be nice if other groups that already use PGO
> could try that locally and spot any issues.
>
Good point! We are aware that LLVM Test Suite is too "SPEC-alike" and lean
toward scientific computation rather than real-world use cases. So we
actually did experiments on the V8 javascript engine, which is absolutely a
huge code base and a good real-world example. And it showed a 10~13% speed
improvement on optimization + codegen time with up to 4% of target
performance overhead (Note that due to some hacky reasons, for many of the
V8 source files, over 80% or even 95% of compilation time was spent on
frontend, so measuring by total compilation time will be heavily skewed and
unable to reflect the impact of this feature)

Best
-Min


>
> cheers,
> --renato
>


-- 
Min-Yih Hsu
Ph.D Student in ICS Department, University of California, Irvine (UCI).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200909/5fd6f8a9/attachment.html>


More information about the cfe-dev mailing list