<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 27, 2012, at 3:10 PM, Jakob Stoklund Olesen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 27, 2012, at 2:31 PM, Andrew Trick wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 26, 2012, at 10:48 PM, Evan Cheng <<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">That seems like a BranchProbabilityInfo deficiency. Andy, what do you think? Benjamin, can you point us to examples of long select chains? Are they in real world benchmarks?</span></blockquote></div><div><br></div><div>Rhetorical question: If we have profile data or simple static heuristics that suggest a biased branch, should we really have turned it into a select?</div><div>Obvious answer: the front end doesn't want to know about condition probabilities.</div><div><br></div><div>...but handling this in any branch profiler won't be clean.</div><div><br></div><div>We'll probably have to plop metadata on the select if we really care that much. When we convert back to control flow, it will be easy to move the metadata to the branch's MD_prof and update BranchProbability if needed. It doesn't seem too hard to add support to LowerExpectIntrinsic.</div></div></blockquote><div><br></div><div>It is not obvious to me that there is a strong correlation between branch bias and branch predictability.</div><div><br></div><div>Branch predictors are much better than 'take the most probable direction'. A 50/50 branch can be perfectly predictable, and conversely a 10/90 branch can be very difficult to predict.</div><div><br></div><div>Using branch bias to estimate predictability only makes sense for strongly biased branches.</div></div></div></blockquote><div><br></div>Right. That's why I suggested using something similar to if-converter's heuristics. It should be the same heuristics except for the opposite direction. If-converter is turning branchy code into predicated code, this pass is turning predicated code back into branchy code.</div><div><br></div><div>Evan<br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><div>/jakob</div><div><br></div></div></div></blockquote></div><br></body></html>