diff options
author | John Brawn <john.brawn@arm.com> | 2018-09-10 12:23:05 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2018-09-10 12:23:05 +0000 |
commit | 8967e18c4a7c2bc9dd88c40a68368da68b452062 (patch) | |
tree | 4bf689eabb0087b7b29938272ca87f7d1872a47e /llvm/lib | |
parent | d1f4571a66311e4422f0a653b944c75291542e2c (diff) | |
download | bcm5719-llvm-8967e18c4a7c2bc9dd88c40a68368da68b452062.tar.gz bcm5719-llvm-8967e18c4a7c2bc9dd88c40a68368da68b452062.zip |
[GVN] Invalidate cached info for values replaced by equality propagation
When GVN propagates an equality by replacing one value with another it also
needs to invalidate the cached information for the value being replaced.
Differential Revision: https://reviews.llvm.org/D51218
llvm-svn: 341820
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index c48e766c797..95c35adb8f5 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1736,6 +1736,9 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS, const BasicBlockEdge &Root, Changed |= NumReplacements > 0; NumGVNEqProp += NumReplacements; + // Cached information for anything that uses LHS will be invalid. + if (MD) + MD->invalidateCachedPointerInfo(LHS); } // Now try to deduce additional equalities from this one. For example, if @@ -1811,6 +1814,9 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS, const BasicBlockEdge &Root, Root.getStart()); Changed |= NumReplacements > 0; NumGVNEqProp += NumReplacements; + // Cached information for anything that uses NotCmp will be invalid. + if (MD) + MD->invalidateCachedPointerInfo(NotCmp); } } // Ensure that any instruction in scope that gets the "A < B" value number |