Use auto profiler to set branch weights

Eric Christopher echristo at gmail.com
Fri Oct 18 16:30:50 PDT 2013


A few general comments:

A comment would be nice for dumpInstrumentedInsns that we don't need
DEBUG for the dbg() statements.

It's handy if the test case has the C/C++/etc code used to reproduce
inside it in case something changes or someone wants to take a fresh
look. Also a comment with what you're testing and where so that people
don't have to guess.

It looks like you're doing the sample information based on line?

-eric



On Fri, Oct 18, 2013 at 3:50 PM, Diego Novillo <dnovillo at google.com> wrote:
> This patch converts instruction samples into branch weights. It
> does a fairly simplistic conversion:
>
> Given a multi-way branch instruction, it calculates the weight of
> each branch based on the maximum sample count gathered from each
> target basic block.
>
> Note that this assignment of branch weights is somewhat lossy and can be
> misleading. If a basic block has more than one incoming branch, all the
> incoming branches will get the same weight. In reality, it may be that
> only one of them is the most heavily taken branch.
>
> I will adjust this assignment in subsequent patches.
>
> Chandler, at this point it may be more convenient to send a full
> patch including all the partial patches I've sent before. If you
> prefer that, please let me know.
>
> All my questions re. guidance still apply to this patch. I've
> focused on getting *something* going, so there are many rough
> corners and incompleteness.
>
>
> 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