OSDN Git Service

[InstSimplify] Use ICmpInst::isEquality predicate method. NFC
authorCraig Topper <craig.topper@gmail.com>
Tue, 6 Jun 2017 07:13:04 +0000 (07:13 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 6 Jun 2017 07:13:04 +0000 (07:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304770 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InstructionSimplify.cpp

index c19af1b..d5b93ca 100644 (file)
@@ -3308,7 +3308,7 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
   }
 
   // icmp eq|ne X, Y -> false|true if X != Y
-  if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_NE) &&
+  if (ICmpInst::isEquality(Pred) &&
       isKnownNonEqual(LHS, RHS, Q.DL, Q.AC, Q.CxtI, Q.DT)) {
     LLVMContext &Ctx = LHS->getType()->getContext();
     return Pred == ICmpInst::ICMP_NE ?