Revert broken srem logic from r126991.
authorNick Lewycky <nicholas@mxc.ca>
Fri, 4 Mar 2011 19:26:08 +0000 (19:26 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 4 Mar 2011 19:26:08 +0000 (19:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127021 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/compare.ll

index 44b0247e5ae53bc3c3b387ed9458c9712dde9fbf..1076eeff2d807ff5217c247196a4a26ee5da6c15 100644 (file)
@@ -1700,21 +1700,6 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
     }
   }
 
-  if (LBO && match(LBO, m_SRem(m_Value(), m_Specific(RHS)))) {
-    switch (Pred) {
-    default:
-      break;
-    case ICmpInst::ICMP_EQ:
-    case ICmpInst::ICMP_SGT:
-    case ICmpInst::ICMP_SGE:
-      return ConstantInt::getFalse(RHS->getContext());
-    case ICmpInst::ICMP_NE:
-    case ICmpInst::ICMP_SLT:
-    case ICmpInst::ICMP_SLE:
-      return ConstantInt::getTrue(RHS->getContext());
-    }
-  }
-
   // If the comparison is with the result of a select instruction, check whether
   // comparing with either branch of the select always yields the same value.
   if (isa<SelectInst>(LHS) || isa<SelectInst>(RHS))
index 11295b7072b406aa6bbae0cfa9d366b668ffabbb..7b92de156d2d0585706f63afb9a762733c7f7828 100644 (file)
@@ -253,15 +253,6 @@ define i1 @srem1(i32 %X) {
 ; CHECK: ret i1 false
 }
 
-define i1 @srem2(i32 %X, i32 %Y) {
-; CHECK: @srem2
-  %neg = sub i32 %Y, 0
-  %A = srem i32 %X, %Y
-  %B = icmp slt i32 %A, %neg
-  ret i1 %B
-; CHECK: ret i1 true
-}
-
 define i1 @udiv1(i32 %X) {
 ; CHECK: @udiv1
   %A = udiv i32 %X, 1000000