[llvm] r235662 - R600: Correctly lower CONCAT_VECTOR nodes with more than 2 operands

Tom Stellard thomas.stellard at amd.com
Thu Apr 23 15:59:25 PDT 2015


Author: tstellar
Date: Thu Apr 23 17:59:24 2015
New Revision: 235662

URL: http://llvm.org/viewvc/llvm-project?rev=235662&view=rev
Log:
R600: Correctly lower CONCAT_VECTOR nodes with more than 2 operands

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
    llvm/trunk/test/CodeGen/R600/concat_vectors.ll

Modified: llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp?rev=235662&r1=235661&r2=235662&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp Thu Apr 23 17:59:24 2015
@@ -839,11 +839,9 @@ SDValue AMDGPUTargetLowering::LowerGloba
 SDValue AMDGPUTargetLowering::LowerCONCAT_VECTORS(SDValue Op,
                                                   SelectionDAG &DAG) const {
   SmallVector<SDValue, 8> Args;
-  SDValue A = Op.getOperand(0);
-  SDValue B = Op.getOperand(1);
 
-  DAG.ExtractVectorElements(A, Args);
-  DAG.ExtractVectorElements(B, Args);
+  for (const SDUse &U : Op->ops())
+    DAG.ExtractVectorElements(U.get(), Args);
 
   return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(Op), Op.getValueType(), Args);
 }

Modified: llvm/trunk/test/CodeGen/R600/concat_vectors.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/concat_vectors.ll?rev=235662&r1=235661&r2=235662&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/concat_vectors.ll (original)
+++ llvm/trunk/test/CodeGen/R600/concat_vectors.ll Thu Apr 23 17:59:24 2015
@@ -283,3 +283,14 @@ define void @test_concat_v16i16(<32 x i1
   store <32 x i16> %concat, <32 x i16> addrspace(1)* %out, align 64
   ret void
 }
+
+; FUNC-LABEL: {{^}}concat_vector_crash:
+; SI: s_endpgm
+define void @concat_vector_crash(<8 x float> addrspace(1)* %out, <2 x float> addrspace(1)* %in) {
+bb:
+  %tmp = load <2 x float>, <2 x float> addrspace(1)* %in, align 4
+  %tmp1 = shufflevector <2 x float> %tmp, <2 x float> undef, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
+  %tmp2 = shufflevector <8 x float> undef, <8 x float> %tmp1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>
+  store <8 x float> %tmp2, <8 x float> addrspace(1)* %out, align 32
+  ret void
+}





More information about the llvm-commits mailing list