<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; "><br><div><div>On Apr 30, 2012, at 10:49 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"><div bgcolor="#FFFFFF"><div><br><br>On Apr 27, 2012, at 2:31 PM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><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></blockquote><div><br></div>While the frontend does emit some selects, I think a lot of selects come from optimization passes like simplifycfg. I'm actually not sure whether these passes should consult probability. Selects seem to be as much a canonicalication as an optimization. I'm ok with them being aggressive in forming selects but they should keep the probability info around. </div></blockquote><br></div><div>Absolutely. I posed that question because I think of selects as being anti-canonical. In general, I like optimizations to be designed to work in the presence of control flow and phis from the start. But that's purely hypothetical. We can make canonicalization to selects with probabilities work with a little effort. Either way, the canonical form should not depend on profile data.</div><div><br></div><div>-Andy</div></body></html>