[PATCH] CodeGenPrepare: Avoid and/or i1 in select conditions.

Matthias Braun matze at braunis.de
Fri Feb 6 11:47:37 PST 2015


SelectionDAGBuilder::visitBr

> On Feb 6, 2015, at 11:43 AM, hfinkel at anl.gov wrote:
> 
> In http://reviews.llvm.org/D7399#119931, @MatzeB wrote:
> 
>> On a side note: Ahmed just mentioned a snipped from SelectionDAGBuilder to me that has pretty much the same logic I do for selects implemented for branches:
>> 
>>  // If this is a series of conditions that are or'd or and'd together, emit
>>   // this as a sequence of branches instead of setcc's with and/or operations.
>>   // As long as jumps are not expensive, this should improve performance.
>>   // For example, instead of something like:
>>   //     cmp A, B
>>   //     C = seteq
>>   //     cmp D, E
>>   //     F = setle
>>   //     or C, F
>>   //     jnz foo
>>   // Emit:
>>   //     cmp A, B
>>   //     je foo
>>   //     cmp D, E
>>   //     jle foo
>>   //
>> 
>> ...
>> 
>> no idea why that is in SelectionDAGBuilder, it also doesn't seem strictly beneficial to all targets to me...
> 
> 
> It's not (and it was pointed out to me in a different thread a couple of months ago); which function does this again? I keep forgetting to fix this... (my current plan is to turn it off when TLI->hasMultipleConditionRegisters() is true, which is only the case on PPC AFAIK).
> 
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D7399
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> _______________________________________________
> 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