1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[NFCI][DomTreeUpdater] applyUpdates(): reserve space for updates first

While, indeed, we may end up pushing less updates that we'd reserve space
for, self-dominating updates aren't often enough for that to matter.
But this should matter for normal updates.
This commit is contained in:
Roman Lebedev 2021-04-11 22:02:57 +03:00
parent 15909798a0
commit 645cab47a5

View File

@ -232,6 +232,7 @@ void DomTreeUpdater::applyUpdates(ArrayRef<DominatorTree::UpdateType> Updates) {
return;
if (Strategy == UpdateStrategy::Lazy) {
PendUpdates.reserve(PendUpdates.size() + Updates.size());
for (const auto &U : Updates)
if (!isSelfDominance(U))
PendUpdates.push_back(U);