mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-07 16:42:07 +00:00
[Statepoints] Skip a vector copy when uniquing values.
No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4bb355e885
commit
2a8a1b8c6f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user