[llvm-commits] [llvm] r118378 - in /llvm/trunk: lib/Analysis/InstructionSimplify.cpp lib/Target/README.txt test/Transforms/InstCombine/select.ll

Duncan Sands baldrick at free.fr
Mon Nov 8 05:38:07 PST 2010


Hi Benjamin,

>> Author: baldrick
>> Date: Sun Nov  7 10:12:23 2010
>> New Revision: 118378
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=118378&view=rev
>> Log:
>> Fix a README item: when doing a comparison with the result
>> of a select instruction, see if doing the compare with the
>> true and false values of the select gives the same result.
>> If so, that can be used as the value of the comparison.
>
> Awesome! Should we do the same thing on phi nodes where an icmp
> on all incoming values yields the same result?

that is a bit more tricky since you can get infinite recursion when
doing this kind of analysis on phi nodes unless you protect against it.
I may try to whip something up later this week.

Another thing to consider is doing this "looking through select/phi"
optimization for other instructions, and not just compares.  For
example for logical operations like "and".  What do you think?

Ciao,

Duncan.



More information about the llvm-commits mailing list