Add 'cold' attribute to functions

Duncan Sands baldrick at free.fr
Thu Apr 11 06:18:34 PDT 2013


Hi Diego,

On 10/04/13 23:33, Diego Novillo wrote:
> This patch adds a new function attribute 'cold' to functions.

can you please add a testcase or two checking that this works properly
when the callsite has the 'cold' attribute but the called function does
not.  (It should work automagically, but it would be best to be sure).
This could be useful if the function is not always cold, but some calls
to it are known cold by the front-end somehow.

Ciao, Duncan.

>
> Other than recognizing the attribute, the patch does little else.
> It changes the branch probability analyzer so that edges into
> blocks postdominated by a cold function are given low weight.
>
> I have two follow up patches in progress.  One to add the 'cold'
> attribute to Clang and another one to propagate the cold
> attribute on the dominator tree (edges into blocks dominated by a
> cold call would be given low weight).
>
> OK to commit?  Chandler, I will need help committing the patch as
> I don't have write access to the repo.
>
>
> Thanks.  Diego.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list