Add a return value to make this function more useful.
authorNadav Rotem <nrotem@apple.com>
Tue, 18 Jun 2013 15:57:12 +0000 (15:57 +0000)
committerNadav Rotem <nrotem@apple.com>
Tue, 18 Jun 2013 15:57:12 +0000 (15:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184200 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/VecUtils.cpp
lib/Transforms/Vectorize/VecUtils.h

index 21e6cdde307aaf5364939681994bb5281c966107..658162aa9f6b4005c4bceb51b9e3fcc02afcf624 100644 (file)
@@ -225,7 +225,7 @@ Value *BoUpSLP::isUnsafeToSink(Instruction *Src, Instruction *Dst) {
   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<Value *> Operands) {
     Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(i));
     Operands[i]->replaceAllUsesWith(S);
   }
+
+  return Vec;
 }
 
 int BoUpSLP::getTreeCost(ArrayRef<Value *> VL) {
index d41d2ed63c8d88856a51602bf1eb8a134534ac36..e0d87f71d41e0dbdae9a08418362ee0a92d795ac 100644 (file)
@@ -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