diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-07-26 23:07:55 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-07-26 23:07:55 +0000 |
commit | 67a38a2875f05ea9c219ab73c4398ee675eb4292 (patch) | |
tree | a5858fa365316a162134620715e4416ef74cb8dc /lib/Transforms/Vectorize | |
parent | a629c3a4f05a8e7976142577872aef95f88c86a0 (diff) | |
download | external_llvm-67a38a2875f05ea9c219ab73c4398ee675eb4292.zip external_llvm-67a38a2875f05ea9c219ab73c4398ee675eb4292.tar.gz external_llvm-67a38a2875f05ea9c219ab73c4398ee675eb4292.tar.bz2 |
SLP Vectorier: Don't vectorize really short chains because they are already handled by the SelectionDAG store-vectorizer, which does a better job in deciding when to vectorize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index c1accd3..50e37e9 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -898,8 +898,12 @@ int BoUpSLP::getTreeCost() { DEBUG(dbgs() << "SLP: Calculating cost for tree of size " << VectorizableTree.size() << ".\n"); - if (!VectorizableTree.size()) { - assert(!ExternalUses.size() && "We should not have any external users"); + // Don't vectorize tiny trees. Small load/store chains or consecutive stores + // of constants will be vectoried in SelectionDAG in MergeConsecutiveStores. + if (VectorizableTree.size() < 3) { + if (!VectorizableTree.size()) { + assert(!ExternalUses.size() && "We should not have any external users"); + } return 0; } |