ignore register #0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25223 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 4ecea2f..a89660b 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2078,7 +2078,7 @@
       std::cerr << LBB->getName() << " ";
     std::cerr << (const void*)BBDN->getBasicBlock() << ">";
   } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) {
-    if (G && MRegisterInfo::isPhysicalRegister(R->getReg())) {
+    if (G && R->getReg() && MRegisterInfo::isPhysicalRegister(R->getReg())) {
       std::cerr << " " <<G->getTarget().getRegisterInfo()->getName(R->getReg());
     } else {
       std::cerr << " #" << R->getReg();