Clean up debug printing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2010-10-07 17:56:35 +00:00
parent 1a3d233621
commit 9b24afe41e

View File

@@ -630,34 +630,39 @@ void SplitEditor::openIntv() {
/// not live before Idx, a COPY is not inserted. /// not live before Idx, a COPY is not inserted.
void SplitEditor::enterIntvBefore(SlotIndex Idx) { void SplitEditor::enterIntvBefore(SlotIndex Idx) {
assert(openli_.getLI() && "openIntv not called before enterIntvBefore"); assert(openli_.getLI() && "openIntv not called before enterIntvBefore");
DEBUG(dbgs() << " enterIntvBefore " << Idx);
VNInfo *ParentVNI = curli_->getVNInfoAt(Idx.getUseIndex()); VNInfo *ParentVNI = curli_->getVNInfoAt(Idx.getUseIndex());
if (!ParentVNI) { if (!ParentVNI) {
DEBUG(dbgs() << " enterIntvBefore " << Idx << ": not live\n"); DEBUG(dbgs() << ": not live\n");
return; return;
} }
DEBUG(dbgs() << ": valno " << ParentVNI->id);
truncatedValues.insert(ParentVNI); truncatedValues.insert(ParentVNI);
MachineInstr *MI = lis_.getInstructionFromIndex(Idx); MachineInstr *MI = lis_.getInstructionFromIndex(Idx);
assert(MI && "enterIntvBefore called with invalid index"); assert(MI && "enterIntvBefore called with invalid index");
openli_.defByCopyFrom(curli_->reg, ParentVNI, *MI->getParent(), MI); VNInfo *VNI = openli_.defByCopyFrom(curli_->reg, ParentVNI,
DEBUG(dbgs() << " enterIntvBefore " << Idx << ": " << *openli_.getLI() *MI->getParent(), MI);
<< '\n'); openli_.getLI()->addRange(LiveRange(VNI->def, Idx.getDefIndex(), VNI));
DEBUG(dbgs() << ": " << *openli_.getLI() << '\n');
} }
/// enterIntvAtEnd - Enter openli at the end of MBB. /// enterIntvAtEnd - Enter openli at the end of MBB.
void SplitEditor::enterIntvAtEnd(MachineBasicBlock &MBB) { void SplitEditor::enterIntvAtEnd(MachineBasicBlock &MBB) {
assert(openli_.getLI() && "openIntv not called before enterIntvAtEnd"); assert(openli_.getLI() && "openIntv not called before enterIntvAtEnd");
SlotIndex End = lis_.getMBBEndIdx(&MBB); SlotIndex End = lis_.getMBBEndIdx(&MBB);
DEBUG(dbgs() << " enterIntvAtEnd BB#" << MBB.getNumber() << ", " << End);
VNInfo *ParentVNI = curli_->getVNInfoAt(End.getPrevSlot()); VNInfo *ParentVNI = curli_->getVNInfoAt(End.getPrevSlot());
if (!ParentVNI) { if (!ParentVNI) {
DEBUG(dbgs() << " enterIntvAtEnd " << End << ": not live\n"); DEBUG(dbgs() << ": not live\n");
return; return;
} }
DEBUG(dbgs() << ": valno " << ParentVNI->id);
truncatedValues.insert(ParentVNI); truncatedValues.insert(ParentVNI);
VNInfo *VNI = openli_.defByCopyFrom(curli_->reg, ParentVNI, VNInfo *VNI = openli_.defByCopyFrom(curli_->reg, ParentVNI,
MBB, MBB.getFirstTerminator()); MBB, MBB.getFirstTerminator());
// Make sure openli is live out of MBB. // Make sure openli is live out of MBB.
openli_.getLI()->addRange(LiveRange(VNI->def, End, VNI)); openli_.getLI()->addRange(LiveRange(VNI->def, End, VNI));
DEBUG(dbgs() << " enterIntvAtEnd: " << *openli_.getLI() << '\n'); DEBUG(dbgs() << ": " << *openli_.getLI() << '\n');
} }
/// useIntv - indicate that all instructions in MBB should use openli. /// useIntv - indicate that all instructions in MBB should use openli.
@@ -675,13 +680,15 @@ void SplitEditor::useIntv(SlotIndex Start, SlotIndex End) {
/// leaveIntvAfter - Leave openli after the instruction at Idx. /// leaveIntvAfter - Leave openli after the instruction at Idx.
void SplitEditor::leaveIntvAfter(SlotIndex Idx) { void SplitEditor::leaveIntvAfter(SlotIndex Idx) {
assert(openli_.getLI() && "openIntv not called before leaveIntvAfter"); assert(openli_.getLI() && "openIntv not called before leaveIntvAfter");
DEBUG(dbgs() << " leaveIntvAfter " << Idx);
// The interval must be live beyond the instruction at Idx. // The interval must be live beyond the instruction at Idx.
VNInfo *ParentVNI = curli_->getVNInfoAt(Idx.getBoundaryIndex()); VNInfo *ParentVNI = curli_->getVNInfoAt(Idx.getBoundaryIndex());
if (!ParentVNI) { if (!ParentVNI) {
DEBUG(dbgs() << " leaveIntvAfter " << Idx << ": not live\n"); DEBUG(dbgs() << ": not live\n");
return; return;
} }
DEBUG(dbgs() << ": valno " << ParentVNI->id);
MachineBasicBlock::iterator MII = lis_.getInstructionFromIndex(Idx); MachineBasicBlock::iterator MII = lis_.getInstructionFromIndex(Idx);
MachineBasicBlock *MBB = MII->getParent(); MachineBasicBlock *MBB = MII->getParent();
@@ -691,21 +698,19 @@ void SplitEditor::leaveIntvAfter(SlotIndex Idx) {
// Finally we must make sure that openli is properly extended from Idx to the // Finally we must make sure that openli is properly extended from Idx to the
// new copy. // new copy.
openli_.addSimpleRange(Idx.getBoundaryIndex(), VNI->def, ParentVNI); openli_.addSimpleRange(Idx.getBoundaryIndex(), VNI->def, ParentVNI);
DEBUG(dbgs() << " leaveIntvAfter " << Idx << ": " << *openli_.getLI() DEBUG(dbgs() << ": " << *openli_.getLI() << '\n');
<< '\n');
} }
/// leaveIntvAtTop - Leave the interval at the top of MBB. /// leaveIntvAtTop - Leave the interval at the top of MBB.
/// Currently, only one value can leave the interval. /// Currently, only one value can leave the interval.
void SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) { void SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) {
assert(openli_.getLI() && "openIntv not called before leaveIntvAtTop"); assert(openli_.getLI() && "openIntv not called before leaveIntvAtTop");
SlotIndex Start = lis_.getMBBStartIdx(&MBB); SlotIndex Start = lis_.getMBBStartIdx(&MBB);
VNInfo *ParentVNI = curli_->getVNInfoAt(Start); DEBUG(dbgs() << " leaveIntvAtTop BB#" << MBB.getNumber() << ", " << Start);
// Is curli even live-in to MBB? VNInfo *ParentVNI = curli_->getVNInfoAt(Start);
if (!ParentVNI) { if (!ParentVNI) {
DEBUG(dbgs() << " leaveIntvAtTop at " << Start << ": not live\n"); DEBUG(dbgs() << ": not live\n");
return; return;
} }
@@ -716,8 +721,7 @@ void SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) {
// Finally we must make sure that openli is properly extended from Start to // Finally we must make sure that openli is properly extended from Start to
// the new copy. // the new copy.
openli_.addSimpleRange(Start, VNI->def, ParentVNI); openli_.addSimpleRange(Start, VNI->def, ParentVNI);
DEBUG(dbgs() << " leaveIntvAtTop at " << Start << ": " << *openli_.getLI() DEBUG(dbgs() << ": " << *openli_.getLI() << '\n');
<< '\n');
} }
/// closeIntv - Indicate that we are done editing the currently open /// closeIntv - Indicate that we are done editing the currently open