summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PeepholeOptimizer.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-28 10:11:12 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-28 10:11:12 +0000
commit4f6ac16292f5435cd00782757e6794f2bf6b64f5 (patch)
treebbba5b9d8e7f5e816bce01feb0dd5c3c62365821 /llvm/lib/CodeGen/PeepholeOptimizer.cpp
parentb759340fc82a209e36455af5e9dc4e6c0d9e7dfb (diff)
downloadbcm5719-llvm-4f6ac16292f5435cd00782757e6794f2bf6b64f5.tar.gz
bcm5719-llvm-4f6ac16292f5435cd00782757e6794f2bf6b64f5.zip
Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. llvm-svn: 230845
Diffstat (limited to 'llvm/lib/CodeGen/PeepholeOptimizer.cpp')
-rw-r--r--llvm/lib/CodeGen/PeepholeOptimizer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index 283d1f26198..2800d846ff3 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -411,8 +411,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
if (ExtendLife && !ExtendedUses.empty())
// Extend the liveness of the extension result.
- std::copy(ExtendedUses.begin(), ExtendedUses.end(),
- std::back_inserter(Uses));
+ Uses.append(ExtendedUses.begin(), ExtendedUses.end());
// Now replace all uses.
bool Changed = false;
OpenPOWER on IntegriCloud