r200874 - PGO: instrumentation based profiling sets function attributes.

Manman Ren manman.ren at gmail.com
Mon Feb 10 17:45:23 PST 2014


On Sat, Feb 8, 2014 at 10:50 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
>
> On Wed, Feb 5, 2014 at 12:40 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
>> Author: mren
>> Date: Wed Feb  5 14:40:15 2014
>> New Revision: 200874
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=200874&view=rev
>> Log:
>> PGO: instrumentation based profiling sets function attributes.
>>
>> We collect a maximal function count among all functions in the pgo data
>> file.
>> For functions that are hot, we set its InlineHint attribute. For
>> functions that
>> are cold, we set its Cold attribute.
>>
>> We currently treat functions with >= 30% of the maximal function count as
>> hot
>> and functions with <= 1% of the maximal function count are treated as
>> cold.
>> These two numbers are from preliminary tuning on SPEC.
>>
>
> Do you have more specific info from SPEC runs and how these heuristic
> choices compare to other nearby values? (why 1% instead of 2 or 0.5? why 30
> instead of 20 or 40 - etc) I'd love to see the graphs just out of
> curiosity's sake.
>

I only did a limited amount of tuning, no graph yet. I plan to do more
tuning if nobody does that ahead of me.
Ideally we should look at the distribution of the function count, and
decide which functions are hot and which are cold.

Manman


>

>
>>
>> This commit should not affect non-PGO builds and should boost performance
>> on
>> instrumentation based PGO.
>>
>> Added:
>>     cfe/trunk/test/CodeGen/Inputs/instr-attribute.pgodata
>>     cfe/trunk/test/CodeGen/instr-attribute.c
>> Modified:
>>     cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
>>     cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
>>     cfe/trunk/lib/CodeGen/CodeGenPGO.h
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140210/e4865020/attachment.html>


More information about the cfe-commits mailing list