diff options
author | Davide Italiano <davide@freebsd.org> | 2017-05-24 02:30:24 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-05-24 02:30:24 +0000 |
commit | fd9100e056e6417335bc839d35daa549e9848bee (patch) | |
tree | 93ab4f3c5059a80049276aa470ff221bd60e9fe2 /llvm/lib/Transforms/Scalar/NewGVN.cpp | |
parent | db615dd677b65c89266e413ad14bf9377cf84e93 (diff) | |
download | bcm5719-llvm-fd9100e056e6417335bc839d35daa549e9848bee.tar.gz bcm5719-llvm-fd9100e056e6417335bc839d35daa549e9848bee.zip |
[NewGVN] Update additionalUsers when we simplify to a value.
Otherwise we don't revisit an instruction that could be simplified,
and when we verify, we discover there's something that changed, i.e.
what we had wasn't a maximal fixpoint.
Fixes PR32836.
llvm-svn: 303715
Diffstat (limited to 'llvm/lib/Transforms/Scalar/NewGVN.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index 5cfbf6baeaa..3245940a0dd 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -955,6 +955,10 @@ const Expression *NewGVN::checkSimplificationResults(Expression *E, CongruenceClass *CC = ValueToClass.lookup(V); if (CC && CC->getDefiningExpr()) { + // If we simplified to something else, we need to communicate + // that we're users of the value we simplified to. + if (I != V) + addAdditionalUsers(V, I); if (I) DEBUG(dbgs() << "Simplified " << *I << " to " << " expression " << *CC->getDefiningExpr() << "\n"); |