summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVNHoist.cpp
diff options
context:
space:
mode:
authorSebastian Pop <sebpop@gmail.com>2016-08-27 02:48:41 +0000
committerSebastian Pop <sebpop@gmail.com>2016-08-27 02:48:41 +0000
commit4660199a3315513aa18fc4899d39cef17beaea0c (patch)
tree030de39bf1922a5e6e509de73999113a2825b7af /llvm/lib/Transforms/Scalar/GVNHoist.cpp
parentacb857b83180a70f0aa42a8e98f40c4b0537d629 (diff)
downloadbcm5719-llvm-4660199a3315513aa18fc4899d39cef17beaea0c.tar.gz
bcm5719-llvm-4660199a3315513aa18fc4899d39cef17beaea0c.zip
GVN-hoist: invalidate MD cache (PR29144)
Without invalidating the entries in the MD cache we would try to access instructions that were removed in previous iterations of hoisting. Differential Revision: https://reviews.llvm.org/D23927 llvm-svn: 279907
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVNHoist.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GVNHoist.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index e287ba71e0b..4a6e934b573 100644
--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -846,6 +846,8 @@ private:
Repl->intersectOptionalDataWith(I);
combineKnownMetadata(Repl, I);
I->replaceAllUsesWith(Repl);
+ // Also invalidate the Alias Analysis cache.
+ MD->removeInstruction(I);
I->eraseFromParent();
}
OpenPOWER on IntegriCloud