[llvm-commits] [llvm] r136583 - /llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp

Benjamin Kramer benny.kra at googlemail.com
Sat Jul 30 22:05:48 PDT 2011


On 30.07.2011, at 21:48, Jakub Staszak wrote:

>>> 
>>> So instcombiner always moves zero (or constants in general) to RHS?
>> 
>> Yes.
>> 
> 
> Good to know. Fixed in r136586.

There is more:
InstCombine also canonicalizes >= and <= into > and <

"icmp sge i32 %x, 0" becomes "icmp sgt i32 %x, -1"

And I don't think you have to test for the unsigned compares here, instcombine
should fold them to equality compares. Some of them (x uge 0) are even tautologies.

- Ben



More information about the llvm-commits mailing list