[llvm] r268195 - getelementptr instruction, support index vector of EVT.

Igor Breger via llvm-commits llvm-commits at lists.llvm.org
Sun May 1 06:29:12 PDT 2016


Author: ibreger
Date: Sun May  1 08:29:12 2016
New Revision: 268195

URL: http://llvm.org/viewvc/llvm-project?rev=268195&view=rev
Log:
getelementptr instruction, support index vector of EVT.

Differential Revision: http://reviews.llvm.org/D19775

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    llvm/trunk/test/CodeGen/X86/vector-gep.ll

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=268195&r1=268194&r2=268195&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sun May  1 08:29:12 2016
@@ -3245,7 +3245,8 @@ void SelectionDAGBuilder::visitGetElemen
     cast<VectorType>(I.getType())->getVectorNumElements() : 0;
 
   if (VectorWidth && !N.getValueType().isVector()) {
-    MVT VT = MVT::getVectorVT(N.getValueType().getSimpleVT(), VectorWidth);
+    LLVMContext &Context = *DAG.getContext();
+    EVT VT = EVT::getVectorVT(Context, N.getValueType(), VectorWidth);
     SmallVector<SDValue, 16> Ops(VectorWidth, N);
     N = DAG.getNode(ISD::BUILD_VECTOR, dl, VT, Ops);
   }

Modified: llvm/trunk/test/CodeGen/X86/vector-gep.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-gep.ll?rev=268195&r1=268194&r2=268195&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-gep.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-gep.ll Sun May  1 08:29:12 2016
@@ -114,3 +114,12 @@ entry:
   ret <4 x i16*> %A
 ;CHECK: ret
 }
+
+;CHECK-LABEL: AGEP9:
+define <64 x i16*> @AGEP9(i16* %param, <64 x i32> %off) nounwind {
+entry:
+;CHECK: vbroadcastss
+  %A = getelementptr i16, i16* %param, <64 x i32> %off
+  ret <64 x i16*> %A
+;CHECK: ret
+}




More information about the llvm-commits mailing list