diff --git a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll index be619fdd711..65f02770ab8 100644 --- a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll +++ b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt < %s -basic-aa -slp-vectorizer -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7 | FileCheck %s +; RUN: opt < %s -basic-aa -slp-vectorizer -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s define void @tiny_tree_fully_vectorizable(double* noalias nocapture %dst, double* noalias nocapture readonly %src, i64 %count) #0 { ; CHECK-LABEL: @tiny_tree_fully_vectorizable( @@ -266,3 +266,46 @@ entry: store i32 40, i32* %ptr3, align 4 ret void } + +define void @tiny_vector_gather(i32 *%a, i32 *%v1, i32 *%v2) { +; CHECK-LABEL: @tiny_vector_gather( +; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[V1:%.*]], align 4 +; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[V2:%.*]], align 4 +; CHECK-NEXT: [[PTR0:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 0 +; CHECK-NEXT: store i32 [[TMP1]], i32* [[PTR0]], align 16 +; CHECK-NEXT: [[PTR1:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 1 +; CHECK-NEXT: store i32 [[TMP2]], i32* [[PTR1]], align 4 +; CHECK-NEXT: [[PTR2:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 2 +; CHECK-NEXT: store i32 [[TMP1]], i32* [[PTR2]], align 8 +; CHECK-NEXT: [[PTR3:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 3 +; CHECK-NEXT: store i32 [[TMP2]], i32* [[PTR3]], align 4 +; CHECK-NEXT: [[PTR4:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 4 +; CHECK-NEXT: store i32 [[TMP1]], i32* [[PTR4]], align 16 +; CHECK-NEXT: [[PTR5:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 5 +; CHECK-NEXT: store i32 [[TMP2]], i32* [[PTR5]], align 4 +; CHECK-NEXT: [[PTR6:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 6 +; CHECK-NEXT: store i32 [[TMP1]], i32* [[PTR6]], align 8 +; CHECK-NEXT: [[PTR7:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 7 +; CHECK-NEXT: store i32 [[TMP2]], i32* [[PTR7]], align 4 +; CHECK-NEXT: ret void +; + %1 = load i32, i32* %v1, align 4 + %2 = load i32, i32* %v2, align 4 + %ptr0 = getelementptr inbounds i32, i32* %a, i64 0 + store i32 %1, i32* %ptr0, align 16 + %ptr1 = getelementptr inbounds i32, i32* %a, i64 1 + store i32 %2, i32* %ptr1, align 4 + %ptr2 = getelementptr inbounds i32, i32* %a, i64 2 + store i32 %1, i32* %ptr2, align 8 + %ptr3 = getelementptr inbounds i32, i32* %a, i64 3 + store i32 %2, i32* %ptr3, align 4 + %ptr4 = getelementptr inbounds i32, i32* %a, i64 4 + store i32 %1, i32* %ptr4, align 16 + %ptr5 = getelementptr inbounds i32, i32* %a, i64 5 + store i32 %2, i32* %ptr5, align 4 + %ptr6 = getelementptr inbounds i32, i32* %a, i64 6 + store i32 %1, i32* %ptr6, align 8 + %ptr7 = getelementptr inbounds i32, i32* %a, i64 7 + store i32 %2, i32* %ptr7, align 4 + ret void +}