aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2022-08-04 16:23:09 -0400
committerSanjay Patel <spatel@rotateright.com>2022-08-04 17:03:42 -0400
commit657bfa364f3d34f3348827ee29cdf8da99ce57ce (patch)
tree8eb888b2207e6b0a8889d47b3cceaa46ebe730e7 /llvm/lib/Analysis/ValueTracking.cpp
parent49d2071572d484a2b5dc356f59050bb173c8c77c (diff)
downloadllvm-657bfa364f3d34f3348827ee29cdf8da99ce57ce.zip
llvm-657bfa364f3d34f3348827ee29cdf8da99ce57ce.tar.gz
llvm-657bfa364f3d34f3348827ee29cdf8da99ce57ce.tar.bz2
[ValueTracking] reduce code in isImpliedCondICmps; NFC
This copies the implementation of the subsequent match with constants.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp11
1 files changed, 3 insertions, 8 deletions
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<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;
}