[llvm-commits] [llvm] r127021 - in /llvm/trunk: lib/Analysis/InstructionSimplify.cpp test/Transforms/InstSimplify/compare.ll

Nick Lewycky nicholas at mxc.ca
Fri Mar 4 11:26:08 PST 2011


Author: nicholas
Date: Fri Mar  4 13:26:08 2011
New Revision: 127021

URL: http://llvm.org/viewvc/llvm-project?rev=127021&view=rev
Log:
Revert broken srem logic from r126991.

Modified:
    llvm/trunk/lib/Analysis/InstructionSimplify.cpp
    llvm/trunk/test/Transforms/InstSimplify/compare.ll

Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=127021&r1=127020&r2=127021&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Fri Mar  4 13:26:08 2011
@@ -1700,21 +1700,6 @@
     }
   }
 
-  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))

Modified: llvm/trunk/test/Transforms/InstSimplify/compare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/compare.ll?rev=127021&r1=127020&r2=127021&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/compare.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/compare.ll Fri Mar  4 13:26:08 2011
@@ -253,15 +253,6 @@
 ; 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





More information about the llvm-commits mailing list