diff options
author | Davide Italiano <davide@freebsd.org> | 2017-06-20 22:57:40 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-06-20 22:57:40 +0000 |
commit | 0ec715be1fd0081861d7e60c3f776d48d87c266d (patch) | |
tree | 321ccfebe149d85bfc61bb3693b53aba007abd6d /llvm/lib/Transforms | |
parent | 1ce38584880b0db2d1c999333727a74b281764db (diff) | |
download | bcm5719-llvm-0ec715be1fd0081861d7e60c3f776d48d87c266d.tar.gz bcm5719-llvm-0ec715be1fd0081861d7e60c3f776d48d87c266d.zip |
[NewGVN] Fix a bug that made the store verifier less effective.
We weren't actually checking for duplicated stores, as the condition
was always actually false. This was found by Coverity, and I have
no clue how to trigger this in real-world code (although I
tried for a bit).
llvm-svn: 305867
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index 1d74e2094fd..7a7624f7754 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -3025,12 +3025,10 @@ void NewGVN::verifyStoreExpressions() const { // It's okay to have the same expression already in there if it is // identical in nature. // This can happen when the leader of the stored value changes over time. - if (!Okay) { - Okay = Okay && std::get<1>(Res.first->second) == KV.second; - Okay = Okay && - lookupOperandLeader(std::get<2>(Res.first->second)) == - lookupOperandLeader(SE->getStoredValue()); - } + if (!Okay) + Okay = (std::get<1>(Res.first->second) == KV.second) && + (lookupOperandLeader(std::get<2>(Res.first->second)) == + lookupOperandLeader(SE->getStoredValue())); assert(Okay && "Stored expression conflict exists in expression table"); auto *ValueExpr = ValueToExpression.lookup(SE->getStoreInst()); assert(ValueExpr && ValueExpr->equals(*SE) && |