[LLVMdev] ProfileEstimator inconsistency

Benjamin Kramer benny.kra at gmail.com
Wed Dec 12 07:34:28 PST 2012


On 12.12.2012, at 16:20, Roel Jordans <r.jordans at tue.nl> wrote:

> Hello all,
> 
> I was trying to use the profile estimator and ran into the following issue.
> 
> An initial weight is assigned to a function entry in lib/Analysis/ProfileEstimator.cpp on line 340.
> 
> In the code this weight is pow(2.0, 32.0) whereas the comment three lines up explains that this should be 1.0
> 
> Can someone fix this in trunk? (replacing 'pow(2.0, 32.0)' with '1.0' worked for me)

The ProfileEstimatorPass is old and unmaintained, it will be removed eventually. A better idea is to use the branch weight infrastructure. The corresponding heuristics (which are used on a normal optimizer run) can be found in lib/Analysis/BranchProbabilityInfo.cpp.

- Ben





More information about the llvm-dev mailing list