[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun May 11 22:55:00 PDT 2003
Changes in directory llvm/lib/CodeGen:
RegAllocLocal.cpp updated: 1.14 -> 1.15
---
Log message:
Fix tab infestation!
---
Diffs of the changes:
Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.14 llvm/lib/CodeGen/RegAllocLocal.cpp:1.15
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.14 Sun May 4 17:51:30 2003
+++ llvm/lib/CodeGen/RegAllocLocal.cpp Sun May 11 22:54:14 2003
@@ -467,22 +467,22 @@
// spilled to memory.
//
for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
- KE = LV->killed_end(MI); KI != KE; ++KI) {
+ KE = LV->killed_end(MI); KI != KE; ++KI) {
unsigned VirtReg = KI->second;
- unsigned PhysReg = VirtReg;
- if (VirtReg >= MRegisterInfo::FirstVirtualRegister) {
- std::map<unsigned, unsigned>::iterator I =
- Virt2PhysRegMap.find(VirtReg);
- assert(I != Virt2PhysRegMap.end());
- PhysReg = I->second;
- Virt2PhysRegMap.erase(I);
- }
-
- if (PhysReg) {
- DEBUG(std::cerr << "V: " << VirtReg << " P: " << PhysReg
- << " Killed by: " << *MI);
- removePhysReg(PhysReg);
- }
+ unsigned PhysReg = VirtReg;
+ if (VirtReg >= MRegisterInfo::FirstVirtualRegister) {
+ std::map<unsigned, unsigned>::iterator I =
+ Virt2PhysRegMap.find(VirtReg);
+ assert(I != Virt2PhysRegMap.end());
+ PhysReg = I->second;
+ Virt2PhysRegMap.erase(I);
+ }
+
+ if (PhysReg) {
+ DEBUG(std::cerr << "V: " << VirtReg << " P: " << PhysReg
+ << " Killed by: " << *MI);
+ removePhysReg(PhysReg);
+ }
}
}
@@ -501,9 +501,9 @@
if (const unsigned *ImplicitDefs = TID.ImplicitDefs)
for (unsigned i = 0; ImplicitDefs[i]; ++i) {
unsigned Reg = ImplicitDefs[i];
- spillPhysReg(MBB, I, Reg);
- PhysRegsUseOrder.push_back(Reg);
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
+ spillPhysReg(MBB, I, Reg);
+ PhysRegsUseOrder.push_back(Reg);
+ PhysRegsUsed[Reg] = 0; // It is free and reserved now
}
// Okay, we have allocated all of the source operands and spilled any values
@@ -513,19 +513,19 @@
//
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
if (MI->getOperand(i).opIsDef() &&
- MI->getOperand(i).isVirtualRegister()) {
+ MI->getOperand(i).isVirtualRegister()) {
unsigned DestVirtReg = MI->getOperand(i).getAllocatedRegNum();
unsigned DestPhysReg;
- // If DestVirtReg already has a value, forget about it. Why doesn't
- // getReg do this right?
- std::map<unsigned, unsigned>::iterator DestI =
- Virt2PhysRegMap.find(DestVirtReg);
- if (DestI != Virt2PhysRegMap.end()) {
- unsigned PhysReg = DestI->second;
- Virt2PhysRegMap.erase(DestI);
- removePhysReg(PhysReg);
- }
+ // If DestVirtReg already has a value, forget about it. Why doesn't
+ // getReg do this right?
+ std::map<unsigned, unsigned>::iterator DestI =
+ Virt2PhysRegMap.find(DestVirtReg);
+ if (DestI != Virt2PhysRegMap.end()) {
+ unsigned PhysReg = DestI->second;
+ Virt2PhysRegMap.erase(DestI);
+ removePhysReg(PhysReg);
+ }
if (TM->getInstrInfo().isTwoAddrInstr(MI->getOpcode()) && i == 0) {
// must be same register number as the first operand
@@ -536,12 +536,12 @@
"Two address instruction invalid!");
DestPhysReg = MI->getOperand(1).getAllocatedRegNum();
- liberatePhysReg(MBB, I, DestPhysReg);
+ liberatePhysReg(MBB, I, DestPhysReg);
assignVirtToPhysReg(DestVirtReg, DestPhysReg);
} else {
DestPhysReg = getReg(MBB, I, DestVirtReg);
}
- markVirtRegModified(DestVirtReg);
+ markVirtRegModified(DestVirtReg);
MI->SetMachineOperandReg(i, DestPhysReg); // Assign the output register
}
@@ -550,22 +550,22 @@
// kill them now.
//
for (LiveVariables::killed_iterator KI = LV->dead_begin(MI),
- KE = LV->dead_end(MI); KI != KE; ++KI) {
+ KE = LV->dead_end(MI); KI != KE; ++KI) {
unsigned VirtReg = KI->second;
- unsigned PhysReg = VirtReg;
- if (VirtReg >= MRegisterInfo::FirstVirtualRegister) {
- std::map<unsigned, unsigned>::iterator I =
- Virt2PhysRegMap.find(VirtReg);
- assert(I != Virt2PhysRegMap.end());
- PhysReg = I->second;
- Virt2PhysRegMap.erase(I);
- }
-
- if (PhysReg) {
- DEBUG(std::cerr << "V: " << VirtReg << " P: " << PhysReg
- << " dead after: " << *MI);
- removePhysReg(PhysReg);
- }
+ unsigned PhysReg = VirtReg;
+ if (VirtReg >= MRegisterInfo::FirstVirtualRegister) {
+ std::map<unsigned, unsigned>::iterator I =
+ Virt2PhysRegMap.find(VirtReg);
+ assert(I != Virt2PhysRegMap.end());
+ PhysReg = I->second;
+ Virt2PhysRegMap.erase(I);
+ }
+
+ if (PhysReg) {
+ DEBUG(std::cerr << "V: " << VirtReg << " P: " << PhysReg
+ << " dead after: " << *MI);
+ removePhysReg(PhysReg);
+ }
}
}
}
@@ -582,9 +582,9 @@
PhysRegsUsed.begin()->first);
for (std::map<unsigned, unsigned>::iterator I = Virt2PhysRegMap.begin(),
- E = Virt2PhysRegMap.end(); I != E; ++I)
+ E = Virt2PhysRegMap.end(); I != E; ++I)
std::cerr << "Register still mapped: " << I->first << " -> "
- << I->second << "\n";
+ << I->second << "\n";
assert(Virt2PhysRegMap.empty() && "Virtual registers still in phys regs?");
assert(PhysRegsUseOrder.empty() && "Physical regs still allocated?");
More information about the llvm-commits
mailing list