If the target cannot issue a copy for the given source and dest registers, abort...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 9 Feb 2009 22:47:36 +0000 (22:47 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 9 Feb 2009 22:47:36 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp

index aa29d3efa77828f760b361ebf519c3914281639d..1d369c1bc44413e5ba96da375ba71ebeefeca6c6 100644 (file)
@@ -125,10 +125,11 @@ void ScheduleDAGSDNodes::EmitCopyFromReg(SDNode *Node, unsigned ResNo,
   } else {
     // Create the reg, emit the copy.
     VRBase = MRI.createVirtualRegister(DstRC);
-    bool Emitted =
-      TII->copyRegToReg(*BB, End, VRBase, SrcReg, DstRC, SrcRC);
-    Emitted = Emitted; // Silence compiler warning.
-    assert(Emitted && "Unable to issue a copy instruction!");
+    bool Emitted = TII->copyRegToReg(*BB, End, VRBase, SrcReg, DstRC, SrcRC);
+    if (!Emitted) {
+      cerr << "Unable to issue a copy instruction!\n";
+      abort();
+    }
   }
 
   SDValue Op(Node, ResNo);
@@ -529,7 +530,11 @@ void ScheduleDAGSDNodes::EmitNode(SDNode *Node, bool IsClone, bool IsCloned,
     else
       DstTRC = TRI->getPhysicalRegisterRegClass(DestReg,
                                             Node->getOperand(1).getValueType());
-    TII->copyRegToReg(*BB, End, DestReg, SrcReg, DstTRC, SrcTRC);
+    bool Emitted = TII->copyRegToReg(*BB, End, DestReg, SrcReg, DstTRC, SrcTRC);
+    if (!Emitted) {
+      cerr << "Unable to issue a copy instruction!\n";
+      abort();
+    }
     break;
   }
   case ISD::CopyFromReg: {