[llvm-commits] Machine Branch Probability Info

Andrew Trick atrick at apple.com
Thu Jun 16 11:09:53 PDT 2011


On Jun 15, 2011, at 3:26 PM, Jakub Staszak wrote:
> Yet another minor change.
> 
> - Kuba
> 
> On Jun 15, 2011, at 2:26 PM, Jakub Staszak wrote:
> 
>> I forgot to "svn add" something, fixed now.
>> 
>> On Jun 15, 2011, at 11:39 AM, Jakub Staszak wrote:
>> 
>>> The new patch attached.
>>> 
>>> - Kuba<mbpi_mbb.patch>

Hi Kuba,

It's looking really good now. Minor observations:

replaceSuccessor will call std::find(Successors...) twice. The second is unnecessary.

Please declare getSuccWeight() const.

I don't see "mach-" used elsewhere as a pass name prefix. I would go with "machine-branch-prob".

This is not something you need to change now, but we probably want a FIXME or comment: DEFAULT_WEIGHT makes sense during static predication, when none of the successors have a weight yet. But it doesn't make sense when providing weight to an edge that may have siblings with non-zero weights. This can be handled various ways, but it's probably fine for an edge with unknown weight to just "inherit" the non-zero weight of an adjacent successor. It may be useful to leave the stored weight as zero (as you're doing now) to distinguish edges that have unknown weight for diagnostics and such.

-Andy




More information about the llvm-commits mailing list