[llvm] r202067 - SLPVectorizer: Try vectorizing 'splat' stores

Hal Finkel hfinkel at anl.gov
Tue Feb 25 05:57:08 PST 2014


----- Original Message -----
> From: "Arnold Schwaighofer" <aschwaighofer at apple.com>
> To: llvm-commits at cs.uiuc.edu
> Sent: Monday, February 24, 2014 1:52:29 PM
> Subject: [llvm] r202067 - SLPVectorizer: Try vectorizing 'splat' stores
> 
> Author: arnolds
> Date: Mon Feb 24 13:52:29 2014
> New Revision: 202067
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=202067&view=rev
> Log:
> SLPVectorizer: Try vectorizing 'splat' stores
> 
> Vectorize sequential stores of a broadcasted value.
> 5% on eon.
> 
> radar://16124699
> 
> Modified:
>     llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
>     llvm/trunk/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
> 
> Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=202067&r1=202066&r2=202067&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Mon Feb 24
> 13:52:29 2014
> @@ -1101,11 +1101,15 @@ bool BoUpSLP::isFullyVectorizableTinyTre
>    if (VectorizableTree.size() != 2)
>      return false;
>  
> +  // Handle splat stores.
> +  if (!VectorizableTree[0].NeedToGather &&
> isSplat(VectorizableTree[1].Scalars))
> +    return true;
> +
>    // Gathering cost would be too much for tiny trees.
> -  if (VectorizableTree[0].NeedToGather ||
> VectorizableTree[1].NeedToGather)
> -    return false;
> +  if (VectorizableTree[0].NeedToGather ||
> VectorizableTree[1].NeedToGather)
> +    return false;
>  
> -  return true;
> +  return true;

What happened here? Are these whitespace changes that I can't see in my e-mail client?

 -Hal

>  }
>  
>  int BoUpSLP::getTreeCost() {
> 
> Modified: llvm/trunk/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/tiny-tree.ll?rev=202067&r1=202066&r2=202067&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
> (original)
> +++ llvm/trunk/test/Transforms/SLPVectorizer/X86/tiny-tree.ll Mon Feb
> 24 13:52:29 2014
> @@ -138,3 +138,18 @@ for.body:
>  for.end:                                          ; preds =
>  %for.body, %entry
>    ret void
>  }
> +
> +
> +; CHECK-LABEL: store_splat
> +; CHECK: store <4 x float>
> +define void @store_splat(float*, float) {
> +  %3 = getelementptr inbounds float* %0, i64 0
> +  store float %1, float* %3, align 4
> +  %4 = getelementptr inbounds float* %0, i64 1
> +  store float %1, float* %4, align 4
> +  %5 = getelementptr inbounds float* %0, i64 2
> +  store float %1, float* %5, align 4
> +  %6 = getelementptr inbounds float* %0, i64 3
> +  store float %1, float* %6, align 4
> +  ret void
> +}
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list