[llvm-commits] [llvm] r64381 - in /llvm/trunk/lib/CodeGen: RegAllocBigBlock.cpp VirtRegMap.cpp

Dan Gohman gohman at apple.com
Thu Feb 12 09:29:01 PST 2009


Author: djg
Date: Thu Feb 12 11:29:01 2009
New Revision: 64381

URL: http://llvm.org/viewvc/llvm-project?rev=64381&view=rev
Log:
Adjust the sizes for a few SmallVectors to reflect their usage.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
    llvm/trunk/lib/CodeGen/VirtRegMap.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp?rev=64381&r1=64380&r2=64381&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Thu Feb 12 11:29:01 2009
@@ -518,7 +518,7 @@
     assignVirtToPhysReg(VirtReg, PhysReg);
   } else {  // no free registers available.
     // try to fold the spill into the instruction
-    SmallVector<unsigned, 2> Ops;
+    SmallVector<unsigned, 1> Ops;
     Ops.push_back(OpNum);
     if(MachineInstr* FMI = TII->foldMemoryOperand(*MF, MI, Ops, FrameIndex)) {
       ++NumFolded;

Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=64381&r1=64380&r2=64381&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Thu Feb 12 11:29:01 2009
@@ -1053,7 +1053,7 @@
       NewMIs.clear();
       int Idx = NewMI->findRegisterUseOperandIdx(VirtReg, false);
       assert(Idx != -1);
-      SmallVector<unsigned, 2> Ops;
+      SmallVector<unsigned, 1> Ops;
       Ops.push_back(Idx);
       MachineInstr *FoldedMI = TII->foldMemoryOperand(MF, NewMI, Ops, SS);
       if (FoldedMI) {
@@ -1124,7 +1124,7 @@
     MachineInstr *CommutedMI = TII->commuteInstruction(DefMI, true);
     if (!CommutedMI)
       return false;
-    SmallVector<unsigned, 2> Ops;
+    SmallVector<unsigned, 1> Ops;
     Ops.push_back(NewDstIdx);
     MachineInstr *FoldedMI = TII->foldMemoryOperand(MF, CommutedMI, Ops, SS);
     // Not needed since foldMemoryOperand returns new MI.





More information about the llvm-commits mailing list