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

Duncan Sands baldrick at free.fr
Fri Sep 5 01:13:36 PDT 2008


Author: baldrick
Date: Fri Sep  5 03:13:35 2008
New Revision: 55828

URL: http://llvm.org/viewvc/llvm-project?rev=55828&view=rev
Log:
"Fix" PR2762.  The testcase now crashes codegen
elsewhere due to a missing pattern for
v2f64 = sint_to_fp v2i32.  That is PR2687.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Fri Sep  5 03:13:35 2008
@@ -524,7 +524,25 @@
   MVT LoVT, HiVT;
   GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
 
-  GetSplitVector(N->getOperand(0), Lo, Hi);
+  // Split the input.
+  MVT InVT = N->getOperand(0).getValueType();
+  switch (getTypeAction(InVT)) {
+  default: assert(0 && "Unexpected type action!");
+  case Legal: {
+    assert(LoVT == HiVT && "Legal non-power-of-two vector type?");
+    MVT InNVT = MVT::getVectorVT(InVT.getVectorElementType(),
+                                 LoVT.getVectorNumElements());
+    Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, InNVT, N->getOperand(0),
+                     DAG.getIntPtrConstant(0));
+    Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, InNVT, N->getOperand(0),
+                     DAG.getIntPtrConstant(InNVT.getVectorNumElements()));
+    break;
+  }
+  case SplitVector:
+    GetSplitVector(N->getOperand(0), Lo, Hi);
+    break;
+  }
+
   Lo = DAG.getNode(N->getOpcode(), LoVT, Lo);
   Hi = DAG.getNode(N->getOpcode(), HiVT, Hi);
 }





More information about the llvm-commits mailing list