aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/GVNPRE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/GVNPRE.cpp')
-rw-r--r--lib/Transforms/Scalar/GVNPRE.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp
index 69e5f73..9c7c8c2 100644
--- a/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/lib/Transforms/Scalar/GVNPRE.cpp
@@ -757,6 +757,8 @@ void GVNPRE::val_insert(ValueNumberedSet& s, Value* v) {
/// val_replace - Insert a value into a set, replacing any values already in
/// the set that have the same value number
void GVNPRE::val_replace(ValueNumberedSet& s, Value* v) {
+ if (s.count(v)) return;
+
uint32_t num = VN.lookup(v);
Value* leader = find_leader(s, num);
if (leader != 0)