[llvm-commits] [llvm] r48213 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner sabre at nondot.org
Mon Mar 10 23:21:09 PDT 2008


Author: lattner
Date: Tue Mar 11 01:21:08 2008
New Revision: 48213

URL: http://llvm.org/viewvc/llvm-project?rev=48213&view=rev
Log:
compile: double test() {}

into:

_test:
	fldz
	ret

instead of:

_test:
	subl	$12, %esp
	#IMPLICIT_DEF %xmm0
	movsd	%xmm0, (%esp)
	fldl	(%esp)
	addl	$12, %esp
	ret


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=48213&r1=48212&r2=48213&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Mar 11 01:21:08 2008
@@ -1825,8 +1825,10 @@
     assert(MVT::isFloatingPoint(VT) &&
            MVT::isFloatingPoint(Operand.getValueType()) && "Invalid FP cast!");
     if (Operand.getValueType() == VT) return Operand;  // noop conversion.
+    if (Operand.getOpcode() == ISD::UNDEF)
+      return getNode(ISD::UNDEF, VT);
     break;
-    case ISD::SIGN_EXTEND:
+  case ISD::SIGN_EXTEND:
     assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
            "Invalid SIGN_EXTEND!");
     if (Operand.getValueType() == VT) return Operand;   // noop extension





More information about the llvm-commits mailing list