remove a couple more unsafe xforms in the face of overflow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-01-05 01:22:42 +00:00
parent b656601943
commit 5a62d0a038
2 changed files with 0 additions and 34 deletions

View File

@@ -4865,10 +4865,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);
if (isMinValuePlusOne(CI,true)) // A <s MIN+1 -> A == MIN
return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI));
// (icmp slt (sub A B) 1) -> (icmp sle A B)
if (CI->isOne() && match(Op0, m_Sub(m_Value(A), m_Value(B))))
return new ICmpInst(ICmpInst::ICMP_SLE, A, B);
break;
case ICmpInst::ICMP_UGT:
@@ -4892,11 +4888,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);
if (isMaxValueMinusOne(CI, true)) // A >s MAX-1 -> A == MAX
return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI));
// (icmp sgt (sub A B) -1) -> (icmp sge A B)
if (CI->getValue().getSExtValue() == -1 &&
match(Op0, m_Sub(m_Value(A), m_Value(B))))
return new ICmpInst(ICmpInst::ICMP_SGE, A, B);
break;
case ICmpInst::ICMP_ULE: