diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2017-07-07 13:55:55 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2017-07-07 13:55:55 +0000 |
commit | 3f02123f7c3c4c33812ba7a1e6402c33dc0fd0d9 (patch) | |
tree | 8f8b172565933c222f26f7a8acb3e35cb6ad0a83 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 78b0f075f711bb16a261d9972b3154b3072e54d9 (diff) | |
download | bcm5719-llvm-3f02123f7c3c4c33812ba7a1e6402c33dc0fd0d9.tar.gz bcm5719-llvm-3f02123f7c3c4c33812ba7a1e6402c33dc0fd0d9.zip |
[ValueTracking] Fix the identity case (LHS => RHS) when the LHS is false.
Prior to this commit both of the added test cases were passing. However, in the
latter case (test7) we were doing a lot more work to arrive at the same answer
(i.e., we were using isImpliedCondMatchingOperands() to determine the
implication.).
llvm-svn: 307400
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 514b8f29f84..5285fa5b98d 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4405,8 +4405,8 @@ Optional<bool> llvm::isImpliedCondition(const Value *LHS, const Value *RHS, assert(OpTy->getScalarType()->isIntegerTy(1)); // LHS ==> RHS by definition - if (!LHSIsFalse && LHS == RHS) - return true; + if (LHS == RHS) + return !LHSIsFalse; if (OpTy->isVectorTy()) // TODO: extending the code below to handle vectors |