[llvm-branch-commits] [llvm-branch] r109617 - in /llvm/branches/Apple/Hartnell: ./ lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/Generic/2010-07-27-DAGCombineCrash.ll

Bill Wendling isanbard at gmail.com
Wed Jul 28 11:42:11 PDT 2010


Author: void
Date: Wed Jul 28 13:42:11 2010
New Revision: 109617

URL: http://llvm.org/viewvc/llvm-project?rev=109617&view=rev
Log:
$ svn merge -c 109519 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r109519 into '.':
A    test/CodeGen/Generic/2010-07-27-DAGCombineCrash.ll
U    lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Added:
    llvm/branches/Apple/Hartnell/test/CodeGen/Generic/2010-07-27-DAGCombineCrash.ll
      - copied unchanged from r109519, llvm/trunk/test/CodeGen/Generic/2010-07-27-DAGCombineCrash.ll
Modified:
    llvm/branches/Apple/Hartnell/   (props changed)
    llvm/branches/Apple/Hartnell/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Propchange: llvm/branches/Apple/Hartnell/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 28 13:42:11 2010
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Morbo:102475
-/llvm/trunk:104174-104175,105453,107846,108367
+/llvm/trunk:104174-104175,105453,107846,108367,109519

Modified: llvm/branches/Apple/Hartnell/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hartnell/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=109617&r1=109616&r2=109617&view=diff
==============================================================================
--- llvm/branches/Apple/Hartnell/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/branches/Apple/Hartnell/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jul 28 13:42:11 2010
@@ -4375,6 +4375,16 @@
   // If this is a conversion of N elements of one type to N elements of another
   // type, convert each element.  This handles FP<->INT cases.
   if (SrcBitSize == DstBitSize) {
+    EVT VT = EVT::getVectorVT(*DAG.getContext(), DstEltVT,
+                              BV->getValueType(0).getVectorNumElements());
+
+    // Due to the FP element handling below calling this routine recursively,
+    // we can end up with a scalar-to-vector node here.
+    if (BV->getOpcode() == ISD::SCALAR_TO_VECTOR)
+      return DAG.getNode(ISD::SCALAR_TO_VECTOR, BV->getDebugLoc(), VT, 
+                         DAG.getNode(ISD::BIT_CONVERT, BV->getDebugLoc(),
+                                     DstEltVT, BV->getOperand(0)));
+      
     SmallVector<SDValue, 8> Ops;
     for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) {
       SDValue Op = BV->getOperand(i);
@@ -4386,8 +4396,6 @@
                                 DstEltVT, Op));
       AddToWorkList(Ops.back().getNode());
     }
-    EVT VT = EVT::getVectorVT(*DAG.getContext(), DstEltVT,
-                              BV->getValueType(0).getVectorNumElements());
     return DAG.getNode(ISD::BUILD_VECTOR, BV->getDebugLoc(), VT,
                        &Ops[0], Ops.size());
   }





More information about the llvm-branch-commits mailing list