[Hexagon-ish] Add function to print cell map contents in bit tracker

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Krzysztof Parzyszek 2016-08-03 18:13:32 +00:00
parent 245fddf078
commit e69cb72fc1
2 changed files with 10 additions and 5 deletions

View File

@ -169,6 +169,12 @@ namespace llvm {
}
}
void BitTracker::print_cells(raw_ostream &OS) const {
for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n";
}
BitTracker::BitTracker(const MachineEvaluator &E, MachineFunction &F)
: Trace(false), ME(E), MF(F), MRI(F.getRegInfo()), Map(*new CellMapType) {}
@ -1127,10 +1133,7 @@ void BT::run() {
}
} // while (!FlowQ->empty())
if (Trace) {
dbgs() << "Cells after propagation:\n";
for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n";
}
if (Trace)
print_cells(dbgs() << "Cells after propagation:\n");
}

View File

@ -51,6 +51,8 @@ struct BitTracker {
bool reached(const MachineBasicBlock *B) const;
void visit(const MachineInstr &MI);
void print_cells(raw_ostream &OS) const;
private:
void visitPHI(const MachineInstr &PI);
void visitNonBranch(const MachineInstr &MI);