[llvm-commits] [llvm] r102927 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dan Gohman gohman at apple.com
Mon May 3 11:00:24 PDT 2010


Author: djg
Date: Mon May  3 13:00:24 2010
New Revision: 102927

URL: http://llvm.org/viewvc/llvm-project?rev=102927&view=rev
Log:
Use isTrueWhenEqual and isFalseWhenEqual instead of assuming that
SimplifyICmpOperands will simplify such cases to EQ or NE. This makes
the correcntess of the code independent on SimplifyICmpOperands doing
certain simplifications.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=102927&r1=102926&r2=102927&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon May  3 13:00:24 2010
@@ -5260,10 +5260,10 @@
   // canonicalized the comparison.
   if (SimplifyICmpOperands(Pred, LHS, RHS))
     if (LHS == RHS)
-      return Pred == ICmpInst::ICMP_EQ;
+      return CmpInst::isTrueWhenEqual(Pred);
   if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
     if (FoundLHS == FoundRHS)
-      return Pred == ICmpInst::ICMP_NE;
+      return CmpInst::isFalseWhenEqual(Pred);
 
   // Check to see if we can make the LHS or RHS match.
   if (LHS == FoundRHS || RHS == FoundLHS) {





More information about the llvm-commits mailing list