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

Nemanja Ivanovic via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 9 11:26:34 PDT 2020


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

> On Wed, 9 Sep 2020 at 14:27, Nemanja Ivanovic <nemanja.i.ibm at gmail.com>
> wrote:
>
>> A more aesthetic comment I have is that personally, I would prefer a
>> single option with a default percentage (say 0%) rather than having to
>> specify two options.
>>
>
> 0% doesn't mean "don't do it", just means "only do that to functions I
> didn't see running at all", which could be misrepresented in the profiling
> run.
>
> If we agree this should be *always* enabled, then only one option is
> needed. Otherwise, we'd need negative percentages to mean "don't do that"
> and that would be weird. :)
>
> I am not sure I follow. My suggestion was to have one option that would
give you a default of 0% (i.e. only add the attribute on functions that
were never called). So the semantics would be fairly straightforward:
- Default (i.e. no -profile-deopt-cold): do nothing
- Option with no arg (i.e. -profile-deopt-cold): add attribute only to
functions that have an execution count of zero
- Option with an arg (i.e. -profile-deopt-cold=<N>): add attribute to
functions that account for <N>% of total execution counts


>
>> Also, it might be useful to add an option to dump the names of functions
>> that are decorated so the user can track an execution count of such
>> functions when running their code. But of course, the debug messages may be
>> adequate for this purpose.
>>
>
> Remark options should be enough for that.
>
> --renato
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200909/4b2a852f/attachment-0001.html>


More information about the llvm-dev mailing list