[llvm] r183465 - CodeGenSchedule: Use resize instead of copying a vector

Arnold Schwaighofer aschwaighofer at apple.com
Thu Jun 6 17:04:30 PDT 2013


Author: arnolds
Date: Thu Jun  6 19:04:30 2013
New Revision: 183465

URL: http://llvm.org/viewvc/llvm-project?rev=183465&view=rev
Log:
CodeGenSchedule: Use resize instead of copying a vector

Modified:
    llvm/trunk/utils/TableGen/CodeGenSchedule.cpp

Modified: llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenSchedule.cpp?rev=183465&r1=183464&r2=183465&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenSchedule.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenSchedule.cpp Thu Jun  6 19:04:30 2013
@@ -1173,8 +1173,8 @@ pushVariant(const TransVariant &VInfo, b
     // Make N-1 copies of this transition's last sequence.
     for (unsigned i = 1, e = SelectedRWs.size(); i != e; ++i) {
       // Create a temporary copy the vector could reallocate.
-      SmallVector<unsigned, 4> Tmp = RWSequences[OperIdx];
-      RWSequences.push_back(Tmp);
+      RWSequences.reserve(RWSequences.size() + 1);
+      RWSequences.push_back(RWSequences[OperIdx]);
     }
     // Push each of the N elements of the SelectedRWs onto a copy of the last
     // sequence (split the current operand into N operands).





More information about the llvm-commits mailing list