[llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Jan 23 13:45:17 PST 2005
Changes in directory llvm/lib/CodeGen:
PrologEpilogInserter.cpp updated: 1.39 -> 1.40
---
Log message:
Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
---
Diffs of the changes: (+5 -6)
PrologEpilogInserter.cpp | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.39 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.40
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.39 Fri Jan 21 18:49:16 2005
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Sun Jan 23 15:45:01 2005
@@ -112,7 +112,7 @@
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 @@
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 @@
// 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 @@
--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();
More information about the llvm-commits
mailing list