[PATCH] D70068: [SLP] Enhance SLPVectorizer to vectorize vector aggregate

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 16 02:25:08 PST 2019


anton-afanasyev marked 2 inline comments as done.
anton-afanasyev added inline comments.


================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/pr42022.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
----------------
vporpo wrote:
> Could you replace this test with the smallest test that exposes the issue?
> I think something like this should do the job:
> 
> ```
> ; RUN: opt -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
> 
> ; Checks that vector insertvalues into the struct become SLP seeds.
> define { <2 x float>, <2 x float> } @StructOfVectors(float *%Ptr) {
>   %GEP0 = getelementptr inbounds float, float* %Ptr, i64 0
>   %L0 = load float, float * %GEP0
>   %GEP1 = getelementptr inbounds float, float* %Ptr, i64 1
>   %L1 = load float, float * %GEP1
>   %GEP2 = getelementptr inbounds float, float* %Ptr, i64 2
>   %L2 = load float, float * %GEP2
>   %GEP3 = getelementptr inbounds float, float* %Ptr, i64 3
>   %L3 = load float, float * %GEP3
> 
>   %VecIn0 = insertelement <2 x float> undef, float %L0, i64 0
>   %VecIn1 = insertelement <2 x float> %VecIn0, float %L1, i64 1
> 
>   %VecIn2 = insertelement <2 x float> undef, float %L2, i64 0
>   %VecIn3 = insertelement <2 x float> %VecIn2, float %L3, i64 1
> 
>   %Ret0 = insertvalue {<2 x float>, <2 x float>} undef, <2 x float> %VecIn1, 0
>   %Ret1 = insertvalue {<2 x float>, <2 x float>} %Ret0, <2 x float> %VecIn3, 1
>   ret {<2 x float>, <2 x float>} %Ret1
> }
> 
> ```
Thanks, I've replaced this with your test!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70068/new/

https://reviews.llvm.org/D70068





More information about the llvm-commits mailing list