[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
This commit is contained in:
Davide Italiano 2017-06-20 22:57:40 +00:00
parent 1ce3858488
commit 0ec715be1f
1 changed files with 4 additions and 6 deletions

View File

@ -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) &&