[llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Thu Apr 8 15:29:32 PDT 2004
Changes in directory reopt/lib/LightWtProfiling:
UnpackTraceFunction.cpp updated: 1.50 -> 1.51
---
Log message:
Clean up some debugging printouts; wrap long lines
---
Diffs of the changes: (+19 -11)
Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.50 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.51
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.50 Wed Apr 7 15:39:12 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Thu Apr 8 15:28:07 2004
@@ -65,9 +65,9 @@
/// Source to the location specified by Target, at the beginning of B.
///
void SparcV9ReoptInfo::insertCopyMachineInstrs (AllocInfo &Source,
- AllocInfo &Target,
- MachineBasicBlock &B,
- const Type *Ty) {
+ AllocInfo &Target,
+ MachineBasicBlock &B,
+ const Type *Ty) {
const TargetRegInfo &TRI = TM->getRegInfo ();
std::vector<MachineInstr *> mvec;
int RegType;
@@ -114,7 +114,7 @@
/// Append to B a branch from the end of B to TargetAddr.
///
void SparcV9ReoptInfo::insertBranchMachineInstrs (uint64_t Target,
- MachineBasicBlock &B) {
+ MachineBasicBlock &B) {
// If the target is close enough to fit into the 19-bit disp of a "ba"
// instruction, then we really DO get a "ba" instruction. We get the backend
// to calculate the PC-relative address from the absolute address upon
@@ -133,7 +133,8 @@
/// Returns a pointer to the return instruction in B, if B contains
/// one, or null otherwise.
///
-const MachineInstr *SparcV9ReoptInfo::containsReturnInstr (MachineBasicBlock &B) {
+const MachineInstr *
+SparcV9ReoptInfo::containsReturnInstr (MachineBasicBlock &B) {
for (MachineBasicBlock::const_reverse_iterator i = B.rbegin (),
e = B.rend (); i != e; ++i) {
const MachineInstr &MI = *i;
@@ -143,7 +144,8 @@
return 0;
}
-void SparcV9ReoptInfo::rewriteProlog (MachineFunction &MF, MachineBasicBlock &E) {
+void SparcV9ReoptInfo::rewriteProlog (MachineFunction &MF,
+ MachineBasicBlock &E) {
const TargetRegInfo &TRI = TM->getRegInfo ();
static const unsigned
fp = SparcV9IntRegClass::i6,
@@ -174,20 +176,21 @@
}
}
- DEBUG(std::cerr << "In rewriteProlog()...\n");
- DEBUG(std::cerr << " static stack size is " << getStaticStackSize (MF) <<"\n");
- DEBUG(std::cerr << " reg set (size " << regSet.size () << ") contains: (");
+ DEBUG(std::cerr << "In rewriteProlog()...\n"
+ << " static stack size is " << getStaticStackSize (MF)
+ << "\n"
+ << " reg set (size " << regSet.size () << ") contains: (");
DEBUG(for (std::set<unsigned>::iterator i = regSet.begin (),
e = regSet.end (); i != e; ++i) { std::cerr << *i << " "; });
DEBUG(std::cerr << " )\n\n");
- // 1. Get some stack space: (Stack Frame Size + Space for Regs).
+ // 2. Get some stack space: (Stack Frame Size + Space for Regs).
unsigned stackSize = getStaticStackSize (MF);
int Size = (stackSize + 32 * 8);
E.push_back (BuildMI (V9::ADDi, 3).addMReg (sp).addSImm (-Size).addMReg (sp,
MachineOperand::Def));
- // 2. Save used registers onto the stack.
+ // 3. Save used registers onto the stack.
std::vector<MachineInstr *> mvec;
int RegType;
for (std::set<unsigned>::iterator i = regSet.begin (), e = regSet.end ();
@@ -195,6 +198,9 @@
mvec.clear ();
unsigned R = *i;
unsigned RegType = TRI.getRegType (R);
+ DEBUG (std::cerr << "Saving reg#" << R << ", type = " << RegType << ", "
+ << "Class = " << TRI.getRegClassIDOfRegType(RegType)
+ << "\n");
TRI.cpReg2MemMI (mvec, R, sp, stackSize + R * 8, RegType);
// Add whatever the TargetRegInfo gave us to the MachineBasicBlock we were
// provided.
@@ -202,6 +208,8 @@
ve = mvec.end (); vi != ve; ++vi)
E.push_back (*vi);
}
+
+ //
}
More information about the llvm-commits
mailing list