diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-04-14 03:22:20 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-04-14 03:22:20 +0000 |
commit | 0b9cf8567b3c13c0f69fb7e4ee2dc061cb2acd2a (patch) | |
tree | d36f2bac37cbd71bef89017fa36ee466453e8b91 /llvm/lib/Transforms/Vectorize/VecUtils.cpp | |
parent | dc1ed5785862deadfe9e7b3e3dc7054bc138c53b (diff) | |
download | bcm5719-llvm-0b9cf8567b3c13c0f69fb7e4ee2dc061cb2acd2a.tar.gz bcm5719-llvm-0b9cf8567b3c13c0f69fb7e4ee2dc061cb2acd2a.zip |
SLPVectorizer: add initial support for reduction variable vectorization.
llvm-svn: 179470
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VecUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VecUtils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.cpp b/llvm/lib/Transforms/Vectorize/VecUtils.cpp index d8be0ae721c..4d075c505d2 100644 --- a/llvm/lib/Transforms/Vectorize/VecUtils.cpp +++ b/llvm/lib/Transforms/Vectorize/VecUtils.cpp @@ -208,6 +208,16 @@ Value *BoUpSLP::isUnsafeToSink(Instruction *Src, Instruction *Dst) { return 0; } +void BoUpSLP::vectorizeArith(ValueList &Operands) { + Value *Vec = vectorizeTree(Operands, Operands.size()); + BasicBlock::iterator Loc = cast<Instruction>(Vec); + IRBuilder<> Builder(++Loc); + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { + Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(i)); + Operands[i]->replaceAllUsesWith(S); + } +} + int BoUpSLP::getTreeCost(ValueList &VL) { // Get rid of the list of stores that were removed, and from the // lists of instructions with multiple users. |