Fix a crash compiling povray on UINT_TO_FP from i16.
authorChris Lattner <sabre@nondot.org>
Wed, 12 Jan 2005 04:00:00 +0000 (04:00 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 12 Jan 2005 04:00:00 +0000 (04:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19499 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelPattern.cpp

index 49c16d515a72e25be6b9ba648537c2d055be80de..3238c7450b1ea3ec84df12f933f300e703fcc339 100644 (file)
@@ -350,8 +350,6 @@ namespace {
       // registers required to compute each node.
       ComputeRegPressure(DAG.getRoot());
 
-      //DAG.viewGraph();
-
       // Codegen the basic block.
       Select(DAG.getRoot());
 
@@ -1244,7 +1242,7 @@ unsigned ISel::SelectExpr(SDOperand N) {
     default: break; // No promotion required.
     }
 
-    if (Node->getOpcode() == ISD::UINT_TO_FP && SrcTy == MVT::i32) {
+    if (Node->getOpcode() == ISD::UINT_TO_FP && Result != RealDestReg) {
       // If this is a cast from uint -> double, we need to be careful when if
       // the "sign" bit is set.  If so, we don't want to make a negative number,
       // we want to make a positive number.  Emit code to add an offset if the