ProfileEstimator inconsistency

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