summaryrefslogtreecommitdiff
path: root/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-15 03:16:29 +0000
committerChris Lattner <sabre@nondot.org>2004-10-15 03:16:29 +0000
commit8df6a594d2781777cd25fe2d00818419a8b10e5c (patch)
treea8c91e4a7a834fa960d178245b9d5c866df98914 /lib/CodeGen/VirtRegMap.cpp
parente0c83a86b0f609e7212fba6679453b8e5bd7fa33 (diff)
downloadllvm-8df6a594d2781777cd25fe2d00818419a8b10e5c.tar.gz
llvm-8df6a594d2781777cd25fe2d00818419a8b10e5c.tar.bz2
llvm-8df6a594d2781777cd25fe2d00818419a8b10e5c.tar.xz
This patch adds and improves debugging output. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 4608cdeaf5..dd8eb8705f 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -323,11 +323,13 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
std::map<int, unsigned>::iterator SSI =
SpillSlotsAvailable.find(StackSlot);
if (SSI != SpillSlotsAvailable.end()) {
+ DEBUG(std::cerr << "Reusing SS#" << StackSlot << " from physreg "
+ << MRI->getName(SSI->second) << " for vreg"
+ << VirtReg <<" instead of reloading into physreg "
+ << MRI->getName(VRM.getPhys(VirtReg)) << "\n");
// If this stack slot value is already available, reuse it!
PhysReg = SSI->second;
MI.SetMachineOperandReg(i, PhysReg);
- DEBUG(std::cerr << "Reusing SS#" << StackSlot << " from physreg "
- << MRI->getName(SSI->second) << "\n");
// The only technical detail we have is that we don't know that
// PhysReg won't be clobbered by a reloaded stack slot that occurs
@@ -519,6 +521,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
// If there is a dead store to this stack slot, nuke it now.
MachineInstr *&LastStore = MaybeDeadStores[StackSlot];
if (LastStore) {
+ DEBUG(std::cerr << " Killed store:\t" << *LastStore);
++NumDSE;
MBB.erase(LastStore);
}
@@ -539,7 +542,8 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
PhysRegsAvailable[PhysReg] = StackSlot;
SpillSlotsAvailable[StackSlot] = PhysReg;
DEBUG(std::cerr << "Updating SS#" << StackSlot <<" in physreg "
- << MRI->getName(PhysReg) << "\n");
+ << MRI->getName(PhysReg) << " for virtreg #"
+ << VirtReg << "\n");
++NumStores;
VirtReg = PhysReg;