From fae59b99b8d1942f30a4be609423282c3fd62dd8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 17 Aug 2005 06:06:25 +0000 Subject: [PATCH] Fix a regression on X86, where FP values can be promoted too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22822 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 44553afa3c3..7303ee2add2 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -991,7 +991,10 @@ CopyValueToVirtualRegister(SelectionDAGLowering &SDL, Value *V, unsigned Reg) { return DAG.getCopyToReg(SDL.getRoot(), Reg, Op); } else if (SrcVT < DestVT) { // The src value is promoted to the register. - Op = DAG.getNode(ISD::ZERO_EXTEND, DestVT, Op); + if (MVT::isFloatingPoint(SrcVT)) + Op = DAG.getNode(ISD::FP_EXTEND, DestVT, Op); + else + Op = DAG.getNode(ISD::ZERO_EXTEND, DestVT, Op); return DAG.getCopyToReg(SDL.getRoot(), Reg, Op); } else { // The src value is expanded into multiple registers.