[llvm] r223795 - Revert "Move function to obtain branch weights into the BranchInst class. NFC."

Juergen Ributzka juergen at apple.com
Tue Dec 9 10:18:57 PST 2014


Branch weights are only 32bit (based on createBranchWeights), so the interface of the extract function is misleading by suggesting they are 64bit.

The code for updating the branch weight is more or less verbatim from SelectionDAGBuilder. We will never be able to recover the original branch weights, because there is not enough information to do so. This is mostly a guestimate what the original weights could have been.

> On Dec 9, 2014, at 9:46 AM, Chandler Carruth <chandlerc at google.com> wrote:
> 
> What happens if 2 * FalseWeight wraps the uint64_t?
> 
> I'm not sure why this pattern of code for updating branch weights is sound. Maybe it is,  but it isn't at all clear.why. Do we have some guarantee that these are run through scaleWeights first and so only have 32-bits of active data in it?

createBranchWeight will truncate it to 32bit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141209/31cbffc4/attachment.html>


More information about the llvm-commits mailing list