Fix a crash in --debug code.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 22 Jun 2012 19:51:41 +0000 (19:51 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 22 Jun 2012 19:51:41 +0000 (19:51 +0000)
Don't try to print out the live range of a physreg.

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

lib/CodeGen/RegisterCoalescer.cpp

index 7ef525d9f3c62d84daa6859260d97657eb91a6b0..19b6ffcb51b3ae23491f376512b60b45e5020e39 100644 (file)
@@ -1053,8 +1053,12 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) {
   // Update regalloc hint.
   TRI->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF);
 
-  DEBUG(dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI)
-               << ' ' << LIS->getInterval(CP.getDstReg()) << '\n');
+  DEBUG({
+    dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI);
+    if (!CP.isPhys())
+      dbgs() << LIS->getInterval(CP.getDstReg());
+     dbgs() << '\n';
+  });
 
   ++numJoins;
   return true;