[llvm] r184671 - SLP Vectorizer: Erase instructions outside thevectorizeTree method.

Andy Gibbs andyg1001 at hotmail.co.uk
Mon Jun 24 03:19:34 PDT 2013


On Sunday, June 23, 2013 9:38 PM, Nadav Rotem wrote:
> Author: nadav
> Date: Sun Jun 23 14:38:56 2013
> New Revision: 184671
>
> URL: http://llvm.org/viewvc/llvm-project?rev=184671&view=rev
> Log:
> SLP Vectorizer: Erase instructions outside the vectorizeTree method.
> The RAII builder location guard is saving a reference to instructions, so 
> we can't erase instructions during vectorization.
>
>
> Modified:
>    llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
>
> Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=184671&r1=184670&r2=184671&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sun Jun 23 
> 14:38:56 2013
> @@ -848,6 +848,12 @@ bool FuncSLP::vectorizeStoreChain(ArrayR
>     if (Cost < CostThreshold) {
>       DEBUG(dbgs() << "SLP: Decided to vectorize cost=" << Cost << "\n");
>       vectorizeTree(Operands);
> +
> +      // Remove the scalar stores.
> +      for (int i = 0, e = VF; i < e; ++i)
> +        cast<Instruction>(Operands[i])->eraseFromParent();
> +
> +      // Move to the next bundle.
>       i += VF - 1;
>       Changed = true;
>     }

The outer loop uses "i" too; please consider changing the inner loop
here to use another variable.

> [...snip...]




More information about the llvm-commits mailing list