[llvm] r184200 - Add a return value to make this function more useful.

Eric Christopher echristo at gmail.com
Tue Jun 18 14:24:29 PDT 2013


Some comments for the function? :)

-eric

On Tue, Jun 18, 2013 at 8:57 AM, Nadav Rotem <nrotem at apple.com> wrote:
> Author: nadav
> Date: Tue Jun 18 10:57:12 2013
> New Revision: 184200
>
> URL: http://llvm.org/viewvc/llvm-project?rev=184200&view=rev
> Log:
> Add a return value to make this function more useful.
>
> Modified:
>     llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp
>     llvm/trunk/lib/Transforms/Vectorize/VecUtils.h
>
> Modified: llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp?rev=184200&r1=184199&r2=184200&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp Tue Jun 18 10:57:12 2013
> @@ -225,7 +225,7 @@ Value *BoUpSLP::isUnsafeToSink(Instructi
>    return 0;
>  }
>
> -void BoUpSLP::vectorizeArith(ArrayRef<Value *> Operands) {
> +Value *BoUpSLP::vectorizeArith(ArrayRef<Value *> Operands) {
>    int LastIdx = getLastIndex(Operands, Operands.size());
>    Instruction *Loc = getInsertionPoint(LastIdx);
>    Builder.SetInsertPoint(Loc);
> @@ -241,6 +241,8 @@ void BoUpSLP::vectorizeArith(ArrayRef<Va
>      Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(i));
>      Operands[i]->replaceAllUsesWith(S);
>    }
> +
> +  return Vec;
>  }
>
>  int BoUpSLP::getTreeCost(ArrayRef<Value *> VL) {
>
> Modified: llvm/trunk/lib/Transforms/Vectorize/VecUtils.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VecUtils.h?rev=184200&r1=184199&r2=184200&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/VecUtils.h (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/VecUtils.h Tue Jun 18 10:57:12 2013
> @@ -72,7 +72,7 @@ struct BoUpSLP  {
>    bool vectorizeStores(ArrayRef<StoreInst *> Stores, int costThreshold);
>
>    /// \brief Vectorize a group of scalars into a vector tree.
> -  void vectorizeArith(ArrayRef<Value *> Operands);
> +  Value *vectorizeArith(ArrayRef<Value *> Operands);
>
>    /// \returns the list of new instructions that were added in order to collect
>    /// scalars into vectors. This list can be used to further optimize the gather
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list