[llvm-commits] [llvm] r72993 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/2009-06-06-ConcatVectors.ll
Eli Friedman
eli.friedman at gmail.com
Sat Jun 6 00:08:26 PDT 2009
Author: efriedma
Date: Sat Jun 6 02:08:26 2009
New Revision: 72993
URL: http://llvm.org/viewvc/llvm-project?rev=72993&view=rev
Log:
Fix the expansion for CONCAT_VECTORS so that it doesn't create illegal
types.
Added:
llvm/trunk/test/CodeGen/X86/2009-06-06-ConcatVectors.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=72993&r1=72992&r2=72993&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Jun 6 02:08:26 2009
@@ -2460,23 +2460,7 @@
Results.push_back(ExpandExtractFromVectorThroughStack(SDValue(Node, 0)));
break;
case ISD::CONCAT_VECTORS: {
- // Use extract/insert/build vector for now. We might try to be
- // more clever later.
- SmallVector<SDValue, 8> Ops;
- unsigned NumOperands = Node->getNumOperands();
- for (unsigned i=0; i < NumOperands; ++i) {
- SDValue SubOp = Node->getOperand(i);
- MVT VVT = SubOp.getNode()->getValueType(0);
- MVT EltVT = VVT.getVectorElementType();
- unsigned NumSubElem = VVT.getVectorNumElements();
- for (unsigned j=0; j < NumSubElem; ++j) {
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, SubOp,
- DAG.getIntPtrConstant(j)));
- }
- }
- Tmp1 = DAG.getNode(ISD::BUILD_VECTOR, dl, Node->getValueType(0),
- &Ops[0], Ops.size());
- Results.push_back(Tmp1);
+ Results.push_back(ExpandVectorBuildThroughStack(Node));
break;
}
case ISD::SCALAR_TO_VECTOR:
Added: llvm/trunk/test/CodeGen/X86/2009-06-06-ConcatVectors.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-06-06-ConcatVectors.ll?rev=72993&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2009-06-06-ConcatVectors.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2009-06-06-ConcatVectors.ll Sat Jun 6 02:08:26 2009
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc
+
+define <2 x i64> @_mm_movpi64_pi64(<1 x i64> %a, <1 x i64> %b) nounwind readnone {
+entry:
+ %0 = shufflevector <1 x i64> %a, <1 x i64> %b, <2 x i32> <i32 0, i32 1>
+ ret <2 x i64> %0
+}
+
More information about the llvm-commits
mailing list