OSDN Git Service

[SLP] Fix for PR6246: vectorization for scalar ops on vector elements.
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 2 Dec 2016 12:20:22 +0000 (12:20 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 2 Dec 2016 12:20:22 +0000 (12:20 +0000)
commita985f0f28ed9f0229ae10dfee0edb1ba10bafe42
treece2911e11e6571224654b876aeac8dd6dbe81be1
parent3feaca6736639ecdcf111167a02ac931867192b9
[SLP] Fix for PR6246: vectorization for scalar ops on vector elements.

When trying to vectorize trees that start at insertelement instructions
function tryToVectorizeList() uses vectorization factor calculated as
MinVecRegSize/ScalarTypeSize. But sometimes it does not work as tree
cost for this fixed vectorization factor is too high.
Patch tries to improve the situation. It tries different vectorization
factors from max(PowerOf2Floor(NumberOfVectorizedValues),
MinVecRegSize/ScalarTypeSize) to MinVecRegSize/ScalarTypeSize and tries
to choose the best one.

Differential Revision: https://reviews.llvm.org/D27215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288497 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/arith-fp.ll
test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll