Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit e69cb72

Browse files
author
Krzysztof Parzyszek
committed
[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
1 parent 245fddf commit e69cb72

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/Target/Hexagon/BitTracker.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ namespace llvm {
169169
}
170170
}
171171

172+
void BitTracker::print_cells(raw_ostream &OS) const {
173+
for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
174+
dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n";
175+
}
176+
177+
172178
BitTracker::BitTracker(const MachineEvaluator &E, MachineFunction &F)
173179
: Trace(false), ME(E), MF(F), MRI(F.getRegInfo()), Map(*new CellMapType) {}
174180

@@ -1127,10 +1133,7 @@ void BT::run() {
11271133
}
11281134
} // while (!FlowQ->empty())
11291135

1130-
if (Trace) {
1131-
dbgs() << "Cells after propagation:\n";
1132-
for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
1133-
dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n";
1134-
}
1136+
if (Trace)
1137+
print_cells(dbgs() << "Cells after propagation:\n");
11351138
}
11361139

lib/Target/Hexagon/BitTracker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ struct BitTracker {
5151
bool reached(const MachineBasicBlock *B) const;
5252
void visit(const MachineInstr &MI);
5353

54+
void print_cells(raw_ostream &OS) const;
55+
5456
private:
5557
void visitPHI(const MachineInstr &PI);
5658
void visitNonBranch(const MachineInstr &MI);

0 commit comments

Comments
 (0)