mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-17 18:24:34 +00:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user