summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/VecUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* SLP Vectorizer: Implement multi-block slp-vectorization.Nadav Rotem2013-06-221-1031/+0
| | | | | | | | | Rewrote the SLP-vectorization as a whole-function vectorization pass. It is now able to vectorize chains across multiple basic blocks. It still does not vectorize PHIs, but this should be easy to do now that we scan the entire function. I removed the support for extracting values from trees. We are now able to vectorize more programs, but there are some serious regressions in many workloads (such as flops-6 and mandel-2). llvm-svn: 184647
* SLP Vectorizer: do not search for store-chains that are wider than the ↵Nadav Rotem2013-06-211-2/+4
| | | | | | vector-register size. llvm-svn: 184527
* Clang-format the SLP vectorizer. No functionality change.Nadav Rotem2013-06-201-138/+179
| | | | llvm-svn: 184446
* SLPVectorization: Add a basic support for cross-basic block slp vectorization.Nadav Rotem2013-06-201-1/+5
| | | | | | | We collect gather sequences when we vectorize basic blocks. Gather sequences are excellent hints for vectorization of other basic blocks. llvm-svn: 184444
* SLPVectorizer: handle scalars that are extracted from vectors (using ↵Nadav Rotem2013-06-191-0/+44
| | | | | | ExtractElementInst). llvm-svn: 184325
* SLPVectorizer: start constructing chains at stores that are not power of two.Nadav Rotem2013-06-191-3/+17
| | | | | | | | The type <3 x i8> is a common in graphics and we want to be able to vectorize it. This changes accelerates bullet by 12% and 471_omnetpp by 5%. llvm-svn: 184317
* SLPVectorizer: vectorize compares and selects.Nadav Rotem2013-06-191-3/+75
| | | | llvm-svn: 184282
* Add a return value to make this function more useful.Nadav Rotem2013-06-181-1/+3
| | | | llvm-svn: 184200
* SLPVectorizer: Change the order in which new instructions are added to the ↵Nadav Rotem2013-05-221-51/+110
| | | | | | | | | | | | function. We are not working on a DAG and I ran into a number of problems when I enabled the vectorizations of 'diamond-trees' (trees that share leafs). * Imroved the numbering API. * Changed the placement of new instructions to the last root. * Fixed a bug with external tree users with non-zero lane. * Fixed a bug in the placement of in-tree users. llvm-svn: 182508
* Suppress GCC compiler warnings in release builds about variables that are onlyDuncan Sands2013-05-131-0/+1
| | | | | | read in asserts. llvm-svn: 181689
* SLPVectorizer: Swap LHS and RHS. No functionality change.Nadav Rotem2013-05-131-4/+4
| | | | llvm-svn: 181684
* SLPVectorizer: Fix a bug in the code that generates extracts for values with ↵Nadav Rotem2013-05-121-7/+27
| | | | | | | | multiple users. The external user does not have to be in lane #0. We have to save the lane for each scalar so that we know which vector lane to extract. llvm-svn: 181674
* SLPVectorizer: Clear the map that maps between scalars to vectors after each ↵Nadav Rotem2013-05-121-0/+1
| | | | | | | | round of vectorization. Testcase in the next commit. llvm-svn: 181673
* SLPVectorizer: Add support for trees with external users.Nadav Rotem2013-05-101-9/+50
| | | | | | | | | | | | | For example: bar() { int a = A[i]; int b = A[i+1]; B[i] = a; B[i+1] = b; foo(a); <--- a is used outside the vectorized expression. } llvm-svn: 181648
* SLPVectorize: Add support for vectorization of casts.Nadav Rotem2013-04-211-0/+69
| | | | llvm-svn: 179975
* SLPVectorizer: Fix a bug in the code that scans the tree in search of nodes ↵Nadav Rotem2013-04-211-0/+1
| | | | | | | | with multiple users. We did not terminate the switch case and we executed the search routine twice. llvm-svn: 179974
* VecUtils: Clean up uses of dyn_cast.Benjamin Kramer2013-04-201-4/+4
| | | | llvm-svn: 179936
* SLPVectorizer: Strength reduce SmallVectors to ArrayRefs.Benjamin Kramer2013-04-201-12/+12
| | | | | | Avoids a couple of copies and allows more flexibility in the clients. llvm-svn: 179935
* SLPVectorizer: Improve the cost model for loop invariant broadcast values.Nadav Rotem2013-04-201-8/+23
| | | | llvm-svn: 179930
* Fix the header comment.Nadav Rotem2013-04-201-1/+1
| | | | llvm-svn: 179928
* Use 64bit arithmetic for calculating distance between pointers.Nadav Rotem2013-04-201-2/+2
| | | | llvm-svn: 179927
* SLPVectorizer: Make it a function pass and add code for hoisting the ↵Nadav Rotem2013-04-151-1/+8
| | | | | | vector-gather sequence out of loops. llvm-svn: 179562
* SLP: Document the scalarization cost method.Nadav Rotem2013-04-141-3/+10
| | | | llvm-svn: 179479
* SLPVectorizer: Add support for trees that don't start at binary operators, ↵Nadav Rotem2013-04-141-0/+10
| | | | | | and add the cost of extracting values from the roots of the tree. llvm-svn: 179475
* SLPVectorizer: add initial support for reduction variable vectorization.Nadav Rotem2013-04-141-0/+10
| | | | llvm-svn: 179470
* SLPVectorizer: add support for vectorization of diamond shaped trees. We now ↵Nadav Rotem2013-04-121-35/+207
| | | | | | perform a preliminary traversal of the graph to collect values with multiple users and check where the users came from. llvm-svn: 179414
* We require DataLayout for analyzing the size of stores.Nadav Rotem2013-04-101-1/+1
| | | | llvm-svn: 179206
* Add support for bottom-up SLP vectorization infrastructure.Nadav Rotem2013-04-091-0/+439
This commit adds the infrastructure for performing bottom-up SLP vectorization (and other optimizations) on parallel computations. The infrastructure has three potential users: 1. The loop vectorizer needs to be able to vectorize AOS data structures such as (sum += A[i] + A[i+1]). 2. The BB-vectorizer needs this infrastructure for bottom-up SLP vectorization, because bottom-up vectorization is faster to compute. 3. A loop-roller needs to be able to analyze consecutive chains and roll them into a loop, in order to reduce code size. A loop roller does not need to create vector instructions, and this infrastructure separates the chain analysis from the vectorization. This patch also includes a simple (100 LOC) bottom up SLP vectorizer that uses the infrastructure, and can vectorize this code: void SAXPY(int *x, int *y, int a, int i) { x[i] = a * x[i] + y[i]; x[i+1] = a * x[i+1] + y[i+1]; x[i+2] = a * x[i+2] + y[i+2]; x[i+3] = a * x[i+3] + y[i+3]; } llvm-svn: 179117
OpenPOWER on IntegriCloud