[llvm-commits] [llvm] r170226 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineMulDivRem.cpp test/Transforms/InstCombine/fast-math.ll

Shuxin Yang shuxin.llvm at gmail.com
Mon Dec 17 09:51:43 PST 2012


Your proposed transformation:
      X op (select cond A, B) -> select cond (X op A), (X op B)
could improve performance iff  *BOTH* "X op A" and "X op B" don't need 
extra instructions to evaluate their value.

Other than the "cond ? 1 : 0" expression,  It is hard to imagine 
real-world applications have such opportunities.


On 12/16/12 8:49 AM, Duncan Sands wrote:
> Hi Shuxin,
>
> On 14/12/12 19:46, Shuxin Yang wrote:
>> Author: shuxin_yang
>> Date: Fri Dec 14 12:46:06 2012
>> New Revision: 170226
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=170226&view=rev
>> Log:
>> rdar://12753946
>>
>> Implement rule : "x * (select cond 1.0, 0.0) -> select cond x, 0.0"
>
> this is a special case of:
>
>   X op (select cond A, B) -> select cond (X op A), (X op B)
>
> when X op A and X op B simplify (for example because passing X op A and
> X op B to InstructionSimplify say that they simplify).  Any chance of
> implementing this more general transform instead?
>
> Thanks, Duncan.




More information about the llvm-commits mailing list