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

Matthias Braun matze at braunis.de
Fri Feb 13 14:21:11 PST 2015


We discussed this in IRC, and I think chandler (and you?) told me that DAGCombine is supposed to normalize in a target independent way, as this normalization should or should not be done depending on the target I was told to do it in CodeGenPrepare...

Legality should not be a problem here as there is already a select instruction in use, I don't see why duplicating this select with a different condition (but same true/false input) could not be legal.

- Matthias

> On Feb 13, 2015, at 2:13 PM, hfinkel at anl.gov wrote:
> 
> In http://reviews.llvm.org/D7622#123459, @ab wrote:
> 
>> I should note that this would have been useful as a DAGCombine as
>> well, because for instance on X86, (select (fcmp oeq/une)) is lowered
>> into the pattern matched here.
>> 
>> Matthias tells me doing it as a DAGCombine was frowned upon (why?),
> 
> 
> I also don't understand why this would not be done in DAGCombine. It is basic-block local, and concerns itself with type legality, it seems appropriate for DAGCombine. One complication with DAGCombine is, if SELECT is not legal, then matching this might be hard.
> 
>> so
> 
>> I'm doing pretty much the same thing on X86ISD::CMOV nodes, and will
> 
>> submit shortly.
> 
>> -Ahmed
> 
> 
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D7622
> 
> 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