Skip to content

Commit

Permalink
Fix DEBUG logs in MachineLICM.
Browse files Browse the repository at this point in the history
Summary:
MBBs don't necessarily have a name (in my experience, they almost never
do), in which case this logging is quite unhelpful.  The number seems to
work well.

Reviewers: iteratee

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20533

llvm-svn: 270477
  • Loading branch information
Justin Lebar committed May 23, 2016
1 parent 562469c commit f6f4a2a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions llvm/lib/CodeGen/MachineLICM.cpp
Expand Up @@ -581,14 +581,14 @@ bool MachineLICM::IsGuaranteedToExecute(MachineBasicBlock *BB) {
}

void MachineLICM::EnterScope(MachineBasicBlock *MBB) {
DEBUG(dbgs() << "Entering: " << MBB->getName() << '\n');
DEBUG(dbgs() << "Entering BB#" << MBB->getNumber() << '\n');

// Remember livein register pressure.
BackTrace.push_back(RegPressure);
}

void MachineLICM::ExitScope(MachineBasicBlock *MBB) {
DEBUG(dbgs() << "Exiting: " << MBB->getName() << '\n');
DEBUG(dbgs() << "Exiting BB#" << MBB->getNumber() << '\n');
BackTrace.pop_back();
}

Expand Down Expand Up @@ -1317,12 +1317,10 @@ bool MachineLICM::Hoist(MachineInstr *MI, MachineBasicBlock *Preheader) {
// terminator instructions.
DEBUG({
dbgs() << "Hoisting " << *MI;
if (Preheader->getBasicBlock())
dbgs() << " to MachineBasicBlock "
<< Preheader->getName();
if (MI->getParent()->getBasicBlock())
dbgs() << " from MachineBasicBlock "
<< MI->getParent()->getName();
dbgs() << " from BB#" << MI->getParent()->getNumber();
if (Preheader->getBasicBlock())
dbgs() << " to BB#" << Preheader->getNumber();
dbgs() << "\n";
});

Expand Down

0 comments on commit f6f4a2a

Please sign in to comment.