X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FAnalysis%2FInstructionSimplify.cpp;h=b6d4c02a9eb1473b378b08eced57c7475d6343e2;hp=ae9d6664fb86f992f46588e276ef738321ea74d2;hb=bdab9f9f82592215428e7991cc8713756ee39fd4;hpb=b4fce5a1c18a40ff89a6503afe8fe0b53e14591a diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index ae9d6664fb8..b6d4c02a9eb 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -2360,6 +2360,9 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS, } else if (match(LHS, m_And(m_Value(), m_ConstantInt(CI2)))) { // 'and x, CI2' produces [0, CI2]. Upper = CI2->getValue() + 1; + } else if (match(LHS, m_NUWAdd(m_Value(), m_ConstantInt(CI2)))) { + // 'add nuw x, CI2' produces [CI2, UINT_MAX]. + Lower = CI2->getValue(); } if (Lower != Upper) { ConstantRange LHS_CR = ConstantRange(Lower, Upper);