Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
authorChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2005 21:45:01 +0000 (21:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2005 21:45:01 +0000 (21:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19787 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp

index 6d6706d9e88226758870536441c2b7971bba9336..0585d23ee45f4b98633ff87d0dfbbd92330b54e3 100644 (file)
@@ -112,7 +112,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
     return;
 
   // This bitset contains an entry for each physical register for the target...
-  std::vector<bool> ModifiedRegs(RegInfo->getNumRegs());
+  std::vector<char> ModifiedRegs(RegInfo->getNumRegs());
   unsigned MaxCallFrameSize = 0;
   bool HasCalls = false;
 
@@ -209,7 +209,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
   const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
 
   // Now that we have a stack slot for each register to be saved, insert spill
-  // code into the entry block...
+  // code into the entry block.
   MachineBasicBlock *MBB = Fn.begin();
   MachineBasicBlock::iterator I = MBB->begin();
   for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
@@ -219,8 +219,8 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
 
   // Add code to restore the callee-save registers in each exiting block.
   const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
-  for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
-    // If last instruction is a return instruction, add an epilogue
+  for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI)
+    // If last instruction is a return instruction, add an epilogue.
     if (!FI->empty() && TII.isReturn(FI->back().getOpcode())) {
       MBB = FI;
       I = MBB->end(); --I;
@@ -232,12 +232,11 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
         --I;  // Insert in reverse order
       }
     }
-  }
 }
 
 
 /// calculateFrameObjectOffsets - Calculate actual frame offsets for all of the
-/// abstract stack objects...
+/// abstract stack objects.
 ///
 void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   const TargetFrameInfo &TFI = *Fn.getTarget().getFrameInfo();