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

Nadav Rotem nrotem at apple.com
Tue Jun 18 08:57:13 PDT 2013


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





More information about the llvm-commits mailing list