[llvm] r277622 - [Hexagon-ish] Add function to print cell map contents in bit tracker
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 11:13:33 PDT 2016
Author: kparzysz
Date: Wed Aug 3 13:13:32 2016
New Revision: 277622
URL: http://llvm.org/viewvc/llvm-project?rev=277622&view=rev
Log:
[Hexagon-ish] Add function to print cell map contents in bit tracker
Modified:
llvm/trunk/lib/Target/Hexagon/BitTracker.cpp
llvm/trunk/lib/Target/Hexagon/BitTracker.h
Modified: llvm/trunk/lib/Target/Hexagon/BitTracker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/BitTracker.cpp?rev=277622&r1=277621&r2=277622&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/BitTracker.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/BitTracker.cpp Wed Aug 3 13:13:32 2016
@@ -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");
}
Modified: llvm/trunk/lib/Target/Hexagon/BitTracker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/BitTracker.h?rev=277622&r1=277621&r2=277622&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/BitTracker.h (original)
+++ llvm/trunk/lib/Target/Hexagon/BitTracker.h Wed Aug 3 13:13:32 2016
@@ -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);
More information about the llvm-commits
mailing list