<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Branch weights are only 32bit (based on createBranchWeights), so the interface of the extract function is misleading by suggesting they are 64bit.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 9, 2014, at 9:46 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">What happens if 2 * FalseWeight wraps the uint64_t?</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">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?</div></div></blockquote><div><br class=""></div><div>createBranchWeight will truncate it to 32bit.</div></div></div></body></html>