]> granicus.if.org Git - llvm/commitdiff
Merging r279369 and update the test:
authorHans Wennborg <hans@hanshq.net>
Mon, 22 Aug 2016 21:04:17 +0000 (21:04 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 22 Aug 2016 21:04:17 +0000 (21:04 +0000)
------------------------------------------------------------------------
r279369 | mssimpso | 2016-08-20 07:10:06 -0700 (Sat, 20 Aug 2016) | 1 line

[SLP] Add command line option for minimum tree size (NFC)
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279474 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/AArch64/gather-root.ll

index cd9210695150a9b483958c437ce099a02a591fb6..fb94f7924ee02dc08a6e599287d37bbc0de31863 100644 (file)
@@ -86,6 +86,10 @@ static cl::opt<unsigned> RecursionMaxDepth(
     "slp-recursion-max-depth", cl::init(12), cl::Hidden,
     cl::desc("Limit the recursion depth when building a vectorizable tree"));
 
+static cl::opt<unsigned> MinTreeSize(
+    "slp-min-tree-size", cl::init(3), cl::Hidden,
+    cl::desc("Only vectorize small trees if they are fully vectorizable"));
+
 // Limit the number of alias checks. The limit is chosen so that
 // it has no negative effect on the llvm benchmarks.
 static const unsigned AliasedCheckLimit = 10;
@@ -1843,7 +1847,7 @@ int BoUpSLP::getTreeCost() {
         VectorizableTree.size() << ".\n");
 
   // We only vectorize tiny trees if it is fully vectorizable.
-  if (VectorizableTree.size() < 3 && !isFullyVectorizableTinyTree()) {
+  if (VectorizableTree.size() < MinTreeSize && !isFullyVectorizableTinyTree()) {
     if (VectorizableTree.empty()) {
       assert(!ExternalUses.size() && "We should not have any external users");
     }
index f70972c15d9011696f9ca037653404f873f854bb..aefd015cce2712d74259ffb51486dcfeaf16e051 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: opt < %s -slp-vectorizer -S | FileCheck %s --check-prefix=DEFAULT
-; RUN: opt < %s -slp-recursion-max-depth=0 -slp-vectorizer -S | FileCheck %s --check-prefix=GATHER
+; RUN: opt < %s -slp-schedule-budget=0 -slp-min-tree-size=0 -slp-threshold=-30 -slp-vectorizer -S | FileCheck %s --check-prefix=GATHER
 
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
 target triple = "aarch64--linux-gnu"