[llvm-commits] [llvm] r122248 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp test/Transforms/InstCombine/or.ll

Frits van Bommel fvbommel at gmail.com
Mon Dec 20 10:13:37 PST 2010


On Mon, Dec 20, 2010 at 5:18 PM, Benjamin Kramer
<benny.kra at googlemail.com> wrote:
> Teach InstCombine to merge (icmp ult (X + CA), C1) | (icmp eq X, C2) into (icmp ult (X + CA), C1 + 1) if C2 + CA == C1.

Shouldn't it turn it into (icmp ule (X + CA), C1), to guard against
the case where C1 + 1 overflows? (i.e. C1 is the maximum unsigned
value, aka -1)

And does this already happen for predicates other than ult? (e.g. slt,
sgt, ugt, ...)



More information about the llvm-commits mailing list