Use auto profiler to set branch weights

Diego Novillo dnovillo at google.com
Fri Oct 18 15:50:40 PDT 2013


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Compute-branch-weights-based-on-instruction-samples.patch
Type: text/x-diff
Size: 17166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131018/8ea16e44/attachment.patch>


More information about the llvm-commits mailing list