[llvm-commits] [PATCH] Use predicates more often when optimizing for size

Evan Cheng evan.cheng at apple.com
Thu Apr 7 14:30:57 PDT 2011


On Apr 4, 2011, at 5:30 PM, Eric Christopher wrote:

> 
> On Apr 2, 2011, at 9:56 PM, Sean Bartell wrote:
> 
>> When optimizing for size, we want to use predicates instead of branches
>> to save a few instructions. Predicates are used when the resulting code
>> is at least 1/2 as fast as with branching; this includes almost all
>> cases where predicates can be used. There are, of course, other
>> heuristics--I think GCC just uses a limit of 8 instructions.
>> 
>> Tested with make check in LLVM. I'd appreciate any feedback, since if
>> I'm accepted into GSoC I'll be doing this much more often :).
> 
> Right now optimizing for size in llvm is generally "optimize for size
> without penalizing performance" instead of "optimize for size at all
> costs".
> 
> Otherwise the patch itself looked just fine :)

Eric is right. Unfortunately this means the patch as it is cannot be accepted since the patch has the potential to penalize performance.

Evan

> 
> -eric
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list