diff options
author | Davide Italiano <davide@freebsd.org> | 2017-05-19 04:06:10 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-05-19 04:06:10 +0000 |
commit | ee49f4943c3f83513ed2c230f12df3f40f355e03 (patch) | |
tree | 79a6f97ffb14cae3bd1d5b37f255a1a14890277c /llvm/lib/Transforms | |
parent | 977158488e532bb26d94612fa116c8362202ee4e (diff) | |
download | bcm5719-llvm-ee49f4943c3f83513ed2c230f12df3f40f355e03.tar.gz bcm5719-llvm-ee49f4943c3f83513ed2c230f12df3f40f355e03.zip |
[NewGVN] Delete the old store when we find congruent to a load.
(or non-store, more in general). Fixes PR33086. Caught by the
store verifier.
llvm-svn: 303406
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index 0b6f75093aa..4b6a2fd7fda 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -2111,11 +2111,11 @@ void NewGVN::performCongruenceFinding(Instruction *I, const Expression *E) { // old store expression. In particular, loads do not compare against stored // value, so they will find old store expressions (and associated class // mappings) if we leave them in the table. - if (ClassChanged && isa<StoreExpression>(E)) { + if (ClassChanged && isa<StoreInst>(I)) { auto *OldE = ValueToExpression.lookup(I); // It could just be that the old class died. We don't want to erase it if we // just moved classes. - if (OldE && isa<StoreExpression>(OldE) && !OldE->equals(*E)) + if (OldE && isa<StoreExpression>(OldE) && *E != *OldE) ExpressionToClass.erase(OldE); } ValueToExpression[I] = E; |