From 657bfa364f3d34f3348827ee29cdf8da99ce57ce Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 4 Aug 2022 16:23:09 -0400 Subject: [ValueTracking] reduce code in isImpliedCondICmps; NFC This copies the implementation of the subsequent match with constants. --- llvm/lib/Analysis/ValueTracking.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Analysis/ValueTracking.cpp') diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 2dd671b..1808f48 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -6688,14 +6688,8 @@ static Optional 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 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 isImpliedCondICmps(const ICmpInst *LHS, if (APred == BPred) return isImpliedCondOperands(APred, ALHS, ARHS, BLHS, BRHS, DL, Depth); + return None; } -- cgit v1.1