[llvm-commits] [PATCH] X86: Turn cmovs into branches when profitable.

Andrew Trick atrick at apple.com
Tue May 1 09:58:19 PDT 2012


On Apr 30, 2012, at 10:49 PM, Evan Cheng <evan.cheng at apple.com> wrote:

> 
> 
> On Apr 27, 2012, at 2:31 PM, Andrew Trick <atrick at apple.com> wrote:
> 
>> 
>> On Apr 26, 2012, at 10:48 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>> 
>>> 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?
>> 
>> 
>> 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?
>> Obvious answer: the front end doesn't want to know about condition probabilities.
> 
> 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. 

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.

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120501/b443b7b3/attachment.html>


More information about the llvm-commits mailing list