[llvm-commits] [llvm] r52915 - /llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp

Dan Gohman gohman at apple.com
Mon Jun 30 13:25:31 PDT 2008


Author: djg
Date: Mon Jun 30 15:25:31 2008
New Revision: 52915

URL: http://llvm.org/viewvc/llvm-project?rev=52915&view=rev
Log:
Correct the allocation size for CCState's UsedRegs member, which
only needs one bit for each register. UsedRegs is a SmallVector
sized at 16, so this eliminates a heap allocation/free for every
call and return processed by Legalize on most targets.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp?rev=52915&r1=52914&r2=52915&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp Mon Jun 30 15:25:31 2008
@@ -26,7 +26,7 @@
   // No stack is used.
   StackOffset = 0;
   
-  UsedRegs.resize(TRI.getNumRegs());
+  UsedRegs.resize((TRI.getNumRegs()+31)/32);
 }
 
 // HandleByVal - Allocate a stack slot large enough to pass an argument by





More information about the llvm-commits mailing list