diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-06-13 19:50:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-06-13 19:50:38 +0000 |
commit | 258ea0dbdfdc5b432395e49c158404b8ae90f90c (patch) | |
tree | ced2bac4e06fbee56b902223bda08e27e36aa90a /llvm/lib/Transforms | |
parent | bd7b1c89fccd48bf967881a49d97e6645d4b3338 (diff) | |
download | bcm5719-llvm-258ea0dbdfdc5b432395e49c158404b8ae90f90c.tar.gz bcm5719-llvm-258ea0dbdfdc5b432395e49c158404b8ae90f90c.zip |
[Statepoints] Skip a vector copy when uniquing values.
No functionality change intended.
llvm-svn: 239688
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 6f6ba72c6e6..21ff55c697e 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1659,17 +1659,10 @@ static void relocationViaAlloca( /// vector. Doing so has the effect of changing the output of a couple of /// tests in ways which make them less useful in testing fused safepoints. template <typename T> static void unique_unsorted(SmallVectorImpl<T> &Vec) { - DenseSet<T> Seen; - SmallVector<T, 128> TempVec; - TempVec.reserve(Vec.size()); - for (auto Element : Vec) - TempVec.push_back(Element); - Vec.clear(); - for (auto V : TempVec) { - if (Seen.insert(V).second) { - Vec.push_back(V); - } - } + SmallSet<T, 8> Seen; + Vec.erase(std::remove_if(Vec.begin(), Vec.end(), [&](const T &V) { + return !Seen.insert(V).second; + }), Vec.end()); } /// Insert holders so that each Value is obviously live through the entire |