Dump live intervals in numerical order.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 14 Feb 2012 23:46:21 +0000 (23:46 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 14 Feb 2012 23:46:21 +0000 (23:46 +0000)
The old DenseMap hashed order was very confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150527 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 0e64ec9011887ade789d3fd6acce533362fb7cb5..32f4c5b3ff6bca7dcc5ea9901ce9f104310900f5 100644 (file)
@@ -107,10 +107,21 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
 /// print - Implement the dump method.
 void LiveIntervals::print(raw_ostream &OS, const Module* ) const {
   OS << "********** INTERVALS **********\n";
-  for (const_iterator I = begin(), E = end(); I != E; ++I) {
-    I->second->print(OS, tri_);
-    OS << "\n";
-  }
+
+  // Dump the physregs.
+  for (unsigned Reg = 1, RegE = tri_->getNumRegs(); Reg != RegE; ++Reg)
+    if (const LiveInterval *LI = r2iMap_.lookup(Reg)) {
+      LI->print(OS, tri_);
+      OS << '\n';
+    }
+
+  // Dump the virtregs.
+  for (unsigned Reg = 0, RegE = mri_->getNumVirtRegs(); Reg != RegE; ++Reg)
+    if (const LiveInterval *LI =
+        r2iMap_.lookup(TargetRegisterInfo::index2VirtReg(Reg))) {
+      LI->print(OS, tri_);
+      OS << '\n';
+    }
 
   printInstrs(OS);
 }