[LLVMdev] [llvm-commits] Branch Probability

Evan Cheng evan.cheng at apple.com
Mon Jun 6 16:24:50 PDT 2011


On Jun 5, 2011, at 11:01 AM, Duncan Sands wrote:

> Hi Andrew,
> 
>> Representation: 32-bit unsigned int stored in IR meta-data.
> 
> why store it in the IR, and not just have it be an analysis that you can query
> for branch probabilities?  If you store it in the IR then it may well get out
> of date (eg: when an optimizer realizes that some branches is dead and deletes
> it, resulting in probabilities that don't add up to 1 on the other branches).
> This happens all the time in GCC and is kind of annoying.

We need to store it in IR to support __builtin_expect and dynamical profiling.

Evan

> 
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list