summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/Vectorize/VecUtils.cpp4
-rw-r--r--llvm/lib/Transforms/Vectorize/VecUtils.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.cpp b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
index 21e6cdde307..658162aa9f6 100644
--- a/llvm/lib/Transforms/Vectorize/VecUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
@@ -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) {
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.h b/llvm/lib/Transforms/Vectorize/VecUtils.h
index d41d2ed63c8..e0d87f71d41 100644
--- a/llvm/lib/Transforms/Vectorize/VecUtils.h
+++ b/llvm/lib/Transforms/Vectorize/VecUtils.h
@@ -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
OpenPOWER on IntegriCloud