Add support for ISD::UNDEF to the X86 be
authorChris Lattner <sabre@nondot.org>
Fri, 1 Apr 2005 22:46:45 +0000 (22:46 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 1 Apr 2005 22:46:45 +0000 (22:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20990 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelPattern.cpp

index 5d91fe41b48a801b71e7f86be3cdf303ddec30d2..0e77a7f8b8eea7fcf02a2ace62ac6c62d7bd4d78 100644 (file)
@@ -1384,6 +1384,14 @@ unsigned ISel::SelectExpr(SDOperand N) {
     }
     BuildMI(BB, Opc, 1,Result).addImm(cast<ConstantSDNode>(N)->getValue());
     return Result;
+  case ISD::UNDEF:
+    if (Node->getValueType(0) == MVT::f64) {
+      // FIXME: SHOULD TEACH STACKIFIER ABOUT UNDEF VALUES!
+      BuildMI(BB, X86::FLD0, 0, Result);
+    } else {
+      BuildMI(BB, X86::IMPLICIT_DEF, 0, Result);
+    }
+    return Result;
   case ISD::GlobalAddress: {
     GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
     BuildMI(BB, X86::MOV32ri, 1, Result).addGlobalAddress(GV);