[llvm] 657bfa3 - [ValueTracking] reduce code in isImpliedCondICmps; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 14:03:53 PDT 2022


Author: Sanjay Patel
Date: 2022-08-04T17:03:42-04:00
New Revision: 657bfa364f3d34f3348827ee29cdf8da99ce57ce

URL: https://github.com/llvm/llvm-project/commit/657bfa364f3d34f3348827ee29cdf8da99ce57ce
DIFF: https://github.com/llvm/llvm-project/commit/657bfa364f3d34f3348827ee29cdf8da99ce57ce.diff

LOG: [ValueTracking] reduce code in isImpliedCondICmps; NFC

This copies the implementation of the subsequent match with constants.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 2dd671b4ab9e3..1808f48298171 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -6688,14 +6688,8 @@ static Optional<bool> isImpliedCondICmps(const ICmpInst *LHS,
 
   // Can we infer anything when the two compares have matching operands?
   bool AreSwappedOps;
-  if (isMatchingOps(ALHS, ARHS, BLHS, BRHS, AreSwappedOps)) {
-    if (Optional<bool> Implication = isImpliedCondMatchingOperands(
-            APred, BPred, AreSwappedOps))
-      return Implication;
-    // No amount of additional analysis will infer the second condition, so
-    // early exit.
-    return None;
-  }
+  if (isMatchingOps(ALHS, ARHS, BLHS, BRHS, AreSwappedOps))
+    return isImpliedCondMatchingOperands(APred, BPred, AreSwappedOps);
 
   // Can we infer anything when the LHS operands match and the RHS operands are
   // constants (not necessarily matching)?
@@ -6705,6 +6699,7 @@ static Optional<bool> isImpliedCondICmps(const ICmpInst *LHS,
 
   if (APred == BPred)
     return isImpliedCondOperands(APred, ALHS, ARHS, BLHS, BRHS, DL, Depth);
+
   return None;
 }
 


        


More information about the llvm-commits mailing list