summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-04-11 22:02:57 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-04-11 23:56:22 +0300
commit6d44b3c56d4a80b16f144a52bc841111c0b4d2c2 (patch)
tree4345cf696b02807637686413165650887c5b4e35
parent816cf4146280fbe45683555558fa393b6ff41beb (diff)
downloadllvm-6d44b3c56d4a80b16f144a52bc841111c0b4d2c2.tar.gz
[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.
-rw-r--r--llvm/lib/Analysis/DomTreeUpdater.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DomTreeUpdater.cpp b/llvm/lib/Analysis/DomTreeUpdater.cpp
index 8ac7d9d4efd0..6e299263e66d 100644
--- a/llvm/lib/Analysis/DomTreeUpdater.cpp
+++ b/llvm/lib/Analysis/DomTreeUpdater.cpp
@@ -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);