OSDN Git Service

[InstCombine] Simplify isKnownNegation
authorFangrui Song <maskray@google.com>
Thu, 12 Jul 2018 22:56:23 +0000 (22:56 +0000)
committerFangrui Song <maskray@google.com>
Thu, 12 Jul 2018 22:56:23 +0000 (22:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336957 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ValueTracking.cpp

index 88ed656..42bf427 100644 (file)
@@ -4524,11 +4524,8 @@ bool llvm::isKnownNegation(const Value *X, const Value *Y) {
 
   // X = sub (A, B), Y = sub (B, A)
   Value *A, *B;
-  if (match(X, m_Sub(m_Value(A), m_Value(B))) &&
-      match(Y, m_Sub(m_Specific(B), m_Specific(A))))
-    return true;
-
-  return false;
+  return match(X, m_Sub(m_Value(A), m_Value(B))) &&
+         match(Y, m_Sub(m_Specific(B), m_Specific(A)));
 }
 
 static SelectPatternResult matchSelectPattern(CmpInst::Predicate Pred,