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
This commit is contained in:
Nadav Rotem
2013-07-26 23:07:55 +00:00
parent a629c3a4f0
commit 67a38a2875
2 changed files with 9 additions and 3 deletions

View File

@ -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;
}