diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-17 15:29:18 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-17 15:29:18 +0000 |
commit | 6cd780ff2143656df213359b7a6df9a5a9237e17 (patch) | |
tree | b3689d2b8496e1cc569d85b5c59b0ac1d68beace /llvm/lib/CodeGen/InlineSpiller.cpp | |
parent | 2ba8778157390981ba1e4a3b683aee09aa9f009f (diff) | |
download | bcm5719-llvm-6cd780ff2143656df213359b7a6df9a5a9237e17.tar.gz bcm5719-llvm-6cd780ff2143656df213359b7a6df9a5a9237e17.zip |
Prefer SmallVector::append/insert over push_back loops.
Same functionality, but hoists the vector growth out of the loop.
llvm-svn: 229500
Diffstat (limited to 'llvm/lib/CodeGen/InlineSpiller.cpp')
-rw-r--r-- | llvm/lib/CodeGen/InlineSpiller.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp index 631b42c7348..f0d407fccf9 100644 --- a/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/llvm/lib/CodeGen/InlineSpiller.cpp @@ -576,8 +576,8 @@ MachineInstr *InlineSpiller::traceSiblingValue(unsigned UseReg, VNInfo *UseVNI, std::tie(SVI, Inserted) = SibValues.insert(std::make_pair(NonPHI, SibValueInfo(Reg, NonPHI))); // Add all the PHIs as dependents of NonPHI. - for (unsigned pi = 0, pe = PHIs.size(); pi != pe; ++pi) - SVI->second.Deps.push_back(PHIs[pi]); + SVI->second.Deps.insert(SVI->second.Deps.end(), PHIs.begin(), + PHIs.end()); // This is the first time we see NonPHI, add it to the worklist. if (Inserted) WorkList.push_back(std::make_pair(Reg, NonPHI)); |