Nadav Rotem
ee7ede76f4
Move the max vector width to a constant parameter. No functionality change.
...
llvm-svn: 168570
2012-11-25 16:48:08 +00:00
Nadav Rotem
ef33b5076c
Fix the document style.
...
llvm-svn: 168569
2012-11-25 16:39:01 +00:00
Nadav Rotem
12192f19eb
Refactor the ptr runtime check generation code. No functionality change.
...
llvm-svn: 168568
2012-11-25 16:27:16 +00:00
Nadav Rotem
b15d9fe24d
Rename method. No functionality change.
...
llvm-svn: 168560
2012-11-25 09:13:57 +00:00
Nadav Rotem
bf5173460f
The induction-pointer work is inspired by a research paper. This commit adds a reference.
...
llvm-svn: 168559
2012-11-25 09:09:26 +00:00
Nadav Rotem
ea3824f160
Add support for pointer induction variables even when there is no integer induction variable.
...
llvm-svn: 168558
2012-11-25 08:41:35 +00:00
Nadav Rotem
c3c07e62e8
LoopVectorizer: Add initial support for pointer induction variables (for example: *dst++ = *src++).
...
At the moment we still require to have an integer induction variable (for example: i++).
llvm-svn: 168231
2012-11-17 00:27:03 +00:00
Nadav Rotem
0565b5a279
LoopVectorize: Division reductions generate incorrect code. Remove the part of the code that deals with divs.
...
Thanks to Paul Redmond for catching this while reviewing the code.
llvm-svn: 168142
2012-11-16 06:51:17 +00:00
Nadav Rotem
a43bcddc8d
use the getSplat API. Patch by Paul Redmond.
...
llvm-svn: 167892
2012-11-14 00:02:13 +00:00
Nadav Rotem
12930749ab
Fix a comment typo and add comments.
...
llvm-svn: 167684
2012-11-11 05:15:00 +00:00
Nadav Rotem
1cfef3e9ee
Add support for memory runtime check. When we can, we calculate array bounds.
...
If the arrays are found to be disjoint then we run the vectorized version of
the loop. If they are not, we run the scalar code.
llvm-svn: 167608
2012-11-09 07:09:44 +00:00
Chandler Carruth
acc748b2b5
Fix sign compare warning. Patch by Mahesha HS.
...
llvm-svn: 167282
2012-11-02 05:24:00 +00:00
Nadav Rotem
4cb8cdab5e
LoopVectorize: Preserve NSW, NUW and IsExact flags.
...
llvm-svn: 167174
2012-10-31 21:40:39 +00:00
Nadav Rotem
ec3ab49dda
Put the threshold magic number in a variable.
...
llvm-svn: 167134
2012-10-31 16:22:16 +00:00
Nadav Rotem
1265ea8f8d
Remove enum values since they are not used anymore.
...
llvm-svn: 167131
2012-10-31 16:14:06 +00:00
Nadav Rotem
ce77ab0c24
LoopVectorize: Do not vectorize loops with tiny constant trip counts.
...
llvm-svn: 167101
2012-10-31 03:31:07 +00:00
Nadav Rotem
ff7889196b
Add support for loops that don't start with Zero.
...
This is important for loops in the LAPACK test-suite.
These loops start at 1 because they are auto-converted from fortran.
llvm-svn: 167084
2012-10-31 00:45:26 +00:00
Nadav Rotem
47a299dcc9
Add documentation.
...
llvm-svn: 167055
2012-10-30 22:06:26 +00:00
Nadav Rotem
bc21aceb19
LoopVectorize: Add support for write-only loops when the write destination is a single pointer.
...
Speedup SciMark by 1%
llvm-svn: 167035
2012-10-30 18:36:45 +00:00
Nadav Rotem
b3e8e688da
LoopVectorize: Fix a bug in the initialization of reduction variables. AND needs to start at all-one
...
while XOR, and OR need to start at zero.
llvm-svn: 167032
2012-10-30 18:12:36 +00:00
Nadav Rotem
73ddcfe03f
LoopVectorizer: change debug prints: Print the module identifier when deciding to vectorize. When deciding not to vectorize do not print the called function name because it can be null.
...
llvm-svn: 166989
2012-10-30 00:40:39 +00:00
Nadav Rotem
5ad045a8c5
LoopVectorize: Update and preserve the dominator tree info.
...
llvm-svn: 166970
2012-10-29 21:52:38 +00:00
Nadav Rotem
859366f93f
1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return the type of the split result.
...
2. Change the maximum vectorization width from 4 to 8.
3. A test for both.
llvm-svn: 166864
2012-10-27 04:11:32 +00:00
Nadav Rotem
afae78edab
Refactor the VectorTargetTransformInfo interface.
...
Add getCostXXX calls for different families of opcodes, such as casts, arithmetic, cmp, etc.
Port the LoopVectorizer to the new API.
The LoopVectorizer now finds instructions which will remain uniform after vectorization. It uses this information when calculating the cost of these instructions.
llvm-svn: 166836
2012-10-26 23:49:28 +00:00
Nadav Rotem
579042f71b
LoopVectorize: Teach the cost model to query scalar costs as scalar types and not vectors of 1.
...
llvm-svn: 166715
2012-10-25 21:03:48 +00:00
Nadav Rotem
5ffb049a55
Add support for additional reduction variables: AND, OR, XOR.
...
Patch by Paul Redmond <paul.redmond@intel.com>.
llvm-svn: 166649
2012-10-25 00:08:41 +00:00
Nadav Rotem
4a87683a41
Implement a basic cost model for vector and scalar instructions.
...
llvm-svn: 166642
2012-10-24 23:47:38 +00:00
Nadav Rotem
e4f491e7ee
whitespace
...
llvm-svn: 166622
2012-10-24 20:58:40 +00:00
Nadav Rotem
a721b21c64
LoopVectorizer: Add a basic cost model which uses the VTTI interface.
...
llvm-svn: 166620
2012-10-24 20:36:32 +00:00
Micah Villmow
51e7246cb4
Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this!
...
llvm-svn: 166596
2012-10-24 17:25:11 +00:00
Micah Villmow
6a8f3f9e20
Delete a directory that wasn't supposed to be checked in yet.
...
llvm-svn: 166591
2012-10-24 17:20:04 +00:00
Nadav Rotem
5bed7b4fad
Use the AliasAnalysis isIdentifiedObj because it also understands mallocs and c++ news.
...
PR14158.
llvm-svn: 166491
2012-10-23 18:44:18 +00:00
Nadav Rotem
1c7fc71e69
Don't crash if the load/store pointer is not a GEP.
...
Fix by Shivarama Rao <Shivarama.Rao@amd.com>
llvm-svn: 166427
2012-10-22 18:27:56 +00:00
Nadav Rotem
f17cd27362
Rename a variable.
...
llvm-svn: 166410
2012-10-22 04:53:05 +00:00
Nadav Rotem
03011f1393
Vectorizer: optimize the generation of selects. If the condition is uniform, generate a scalar-cond select (i1 as selector).
...
llvm-svn: 166409
2012-10-22 04:38:00 +00:00
Nadav Rotem
c9741887c3
Update the loop vectorizer docs.
...
llvm-svn: 166408
2012-10-22 03:52:53 +00:00
Anders Carlsson
7d8991c778
Avoid an extra hash lookup when inserting a value into the widen map.
...
llvm-svn: 166395
2012-10-21 16:26:35 +00:00
Jakub Staszak
baa063bd03
Simplify code. No functionality change.
...
llvm-svn: 166393
2012-10-21 15:36:03 +00:00
Jakub Staszak
9694ab8ffa
Simplify code. No functionality change.
...
llvm-svn: 166392
2012-10-21 15:29:19 +00:00
Nadav Rotem
fe88c67161
Fix a bug in the vectorization of wide load/store operations.
...
We used a SCEV to detect that A[X] is consecutive. We assumed that X was
the induction variable. But X can be any expression that uses the induction
for example: X = i + 2;
llvm-svn: 166388
2012-10-21 06:49:10 +00:00
Nadav Rotem
c1679a95b6
Add support for reduction variables that do not start at zero.
...
This is important for nested-loop reductions such as :
In the innermost loop, the induction variable does not start with zero:
for (i = 0 .. n)
for (j = 0 .. m)
sum += ...
llvm-svn: 166387
2012-10-21 05:52:51 +00:00
Nadav Rotem
364bd30641
Document change. Describe the pass and some papers that inspired the design of the pass.
...
llvm-svn: 166386
2012-10-21 04:04:25 +00:00
Nadav Rotem
7e1084d36c
Vectorizer: fix a bug in the classification of induction/reduction phis.
...
llvm-svn: 166384
2012-10-21 02:38:01 +00:00
Nadav Rotem
e5dc57d4fb
Fix an infinite loop in the loop-vectorizer.
...
PR14134.
llvm-svn: 166379
2012-10-20 20:45:01 +00:00
Nadav Rotem
d189b82a9b
Vectorize: teach cavVectorizeMemory to distinguish between A[i]+=x and A[B[i]]+=x.
...
If the pointer is consecutive then it is safe to read and write. If the pointer is non-loop-consecutive then
it is unsafe to vectorize it because we may hit an ordering issue.
llvm-svn: 166371
2012-10-20 08:26:33 +00:00
Nadav Rotem
3940bafb54
Fix a typo
...
llvm-svn: 166367
2012-10-20 05:03:27 +00:00
Nadav Rotem
f70ca3ceed
Vectorizer: refactor the memory checks to a new function. No functionality change.
...
llvm-svn: 166366
2012-10-20 04:59:06 +00:00
Nadav Rotem
550f7f7e19
LoopVectorize: Keep the IRBuilder on the stack.
...
llvm-svn: 166354
2012-10-19 23:27:19 +00:00
Nadav Rotem
4f7f72702b
Vectorizer: Add support for loop reductions.
...
For example:
for (i=0; i<n; i++)
sum += A[i] + B[i] + i;
llvm-svn: 166351
2012-10-19 23:05:40 +00:00
Benjamin Kramer
319cb771b2
LoopVectorize: Keep the IRBuilder on the stack.
...
No functionality change.
llvm-svn: 166274
2012-10-19 08:42:02 +00:00