summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVectorize
Commit message (Collapse)AuthorAgeFilesLines
...
* LoopVectorizer: Optimize the vectorization of consecutive memory access when ↵Nadav Rotem2012-12-261-1/+2
| | | | | | the iteration step is -1 llvm-svn: 171114
* LoopVectorize: Enable vectorization of the fmuladd intrinsicHal Finkel2012-12-251-0/+60
| | | | llvm-svn: 171076
* Fix typo "Makre" -> "Make".Nick Lewycky2012-12-241-6/+4
| | | | llvm-svn: 171043
* LoopVectorizer: When checking for vectorizable types, also checkNadav Rotem2012-12-241-0/+29
| | | | | | | | the StoreInst operands. PR14705. llvm-svn: 171023
* LoopVectorizer: Fix an endless loop in the code that looks for reductions.Nadav Rotem2012-12-241-0/+44
| | | | | | | | The bug was in the code that detects PHIs in if-then-else block sequence. PR14701. llvm-svn: 171008
* CostModel: Change the default target-independent implementation for findingNadav Rotem2012-12-231-3/+3
| | | | | | | | the cost of arithmetic functions. We now assume that the cost of arithmetic operations that are marked as Legal or Promote is low, but ops that are marked as custom are higher. llvm-svn: 171002
* Loop Vectorizer: Update the cost model of scatter/gather operations and makeNadav Rotem2012-12-231-1/+4
| | | | | | them more expensive. llvm-svn: 170995
* Fix a bug in the code that checks if we can vectorize loops while using dynamicNadav Rotem2012-12-212-48/+110
| | | | | | | | | | memory bound checks. Before the fix we were able to vectorize this loop from the Livermore Loops benchmark: for ( k=1 ; k<n ; k++ ) x[k] = x[k-1] + y[k]; llvm-svn: 170811
* LoopVectorize: Fix a bug in the scalarization of instructions.Nadav Rotem2012-12-201-0/+48
| | | | | | | | | | Before if-conversion we could check if a value is loop invariant if it was declared inside the basic block. Now that loops have multiple blocks this check is incorrect. This fixes External/SPEC/CINT95/099_go/099_go llvm-svn: 170756
* Make TargetLowering::getTypeConversion more resilient against odd illegal MVTs.Benjamin Kramer2012-12-191-0/+22
| | | | | | | | | - An MVT can become an EVT when being split (e.g. v2i8 -> v1i8, the latter doesn't exist) - Return the scalar value when an MVT is scalarized (v1i64 -> i64) Fixes PR14639ff. llvm-svn: 170546
* LoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops ↵Benjamin Kramer2012-12-181-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of scalar operations. For example on x86 with SSE4.2 a <8 x i8> add reduction becomes movdqa %xmm0, %xmm1 movhlps %xmm1, %xmm1 ## xmm1 = xmm1[1,1] paddw %xmm0, %xmm1 pshufd $1, %xmm1, %xmm0 ## xmm0 = xmm1[1,0,0,0] paddw %xmm1, %xmm0 phaddw %xmm0, %xmm0 pextrb $0, %xmm0, %edx instead of pextrb $2, %xmm0, %esi pextrb $0, %xmm0, %edx addb %sil, %dl pextrb $4, %xmm0, %esi addb %dl, %sil pextrb $6, %xmm0, %edx addb %sil, %dl pextrb $8, %xmm0, %esi addb %dl, %sil pextrb $10, %xmm0, %edi pextrb $14, %xmm0, %edx addb %sil, %dil pextrb $12, %xmm0, %esi addb %dil, %sil addb %sil, %dl llvm-svn: 170439
* Teach the cost model about the optimization in r169904: Truncation of ↵Nadav Rotem2012-12-131-1/+1
| | | | | | induction variables costs the same as scalar trunc. llvm-svn: 170051
* LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to ↵Nadav Rotem2012-12-121-0/+170
| | | | | | increase the function size. llvm-svn: 170004
* PR14574. Fix a bug in the code that calculates the mask the converted PHIs ↵Nadav Rotem2012-12-111-0/+44
| | | | | | in if-conversion. llvm-svn: 169916
* Loop Vectorize: optimize the vectorization of trunc(induction_var). The ↵Nadav Rotem2012-12-114-4/+33
| | | | | | truncation is now done on scalars. llvm-svn: 169904
* Fix PR14565. Don't if-convert loops that have switch statements in them.Nadav Rotem2012-12-111-0/+39
| | | | llvm-svn: 169813
* Add support for reverse induction variables. For example:Nadav Rotem2012-12-101-4/+2
| | | | | | | while (i--) sum+=A[i]; llvm-svn: 169752
* LoopVectorize: support vectorizing intrinsic callsPaul Redmond2012-12-091-0/+851
| | | | | | | | | - added function to VectorTargetTransformInfo to query cost of intrinsics - vectorize trivially vectorizable intrinsic calls such as sin, cos, log, etc. Reviewed by: Nadav llvm-svn: 169711
* Fix a bug in vectorization of if-converted reduction variables. If theNadav Rotem2012-12-041-0/+38
| | | | | | | reduction variable is not used outside the loop then we ran into an endless loop. This change checks if we found the original PHI. llvm-svn: 169324
* Add support for reduction variables when IF-conversion is enabled. Nadav Rotem2012-12-041-0/+48
| | | | llvm-svn: 169288
* Add the last part that is needed for vectorization of if-converted code.Nadav Rotem2012-12-041-0/+60
| | | | | | | | | | | | | | | | | Added the code that actually performs the if-conversion during vectorization. We can now vectorize this code: for (int i=0; i<n; ++i) { unsigned k = 0; if (a[i] > b[i]) <------ IF inside the loop. k = k * 5 + 3; a[i] = k; <---- K is a phi node that becomes vector-select. } llvm-svn: 169217
* Add support for pointer induction variables even when there is no integer ↵Nadav Rotem2012-11-251-0/+33
| | | | | | induction variable. llvm-svn: 168558
* LoopVectorizer: Add initial support for pointer induction variables (for ↵Nadav Rotem2012-11-171-2/+1
| | | | | | | | example: *dst++ = *src++). At the moment we still require to have an integer induction variable (for example: i++). llvm-svn: 168231
* Relax the restrictions on vector of pointer types, and vector getelementptr.Duncan Sands2012-11-131-2/+2
| | | | | | | | | | | | | | | Previously in a vector of pointers, the pointer couldn't be any pointer type, it had to be a pointer to an integer or floating point type. This is a hassle for dragonegg because the GCC vectorizer happily produces vectors of pointers where the pointer is a pointer to a struct or whatever. Vector getelementptr was restricted to just one index, but now that vectors of pointers can have any pointer type it is more natural to allow arbitrary vector getelementptrs. There is however the issue of struct GEPs, where if each lane chose different struct fields then from that point on each lane will be working down into unrelated types. This seems like too much pain for too little gain, so when you have a vector struct index all the elements are required to be the same. llvm-svn: 167828
* Add support for memory runtime check. When we can, we calculate array bounds.Nadav Rotem2012-11-091-0/+36
| | | | | | | 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
* Cost Model: add tables for some avx type-conversion hacks.Nadav Rotem2012-11-061-1/+1
| | | | llvm-svn: 167480
* Code Model: Improve the accuracy of the zext/sext/trunc vector cost estimation.Nadav Rotem2012-11-051-2/+2
| | | | llvm-svn: 167412
* Implement the cost of abnormal x86 instruction lowering as a table.Nadav Rotem2012-11-051-1/+1
| | | | llvm-svn: 167395
* LoopVectorize: Preserve NSW, NUW and IsExact flags.Nadav Rotem2012-10-317-7/+62
| | | | llvm-svn: 167174
* Fix a bug in the cost calculation of vector casts. Detect situations where ↵Nadav Rotem2012-10-311-0/+48
| | | | | | bitcasts cost zero. llvm-svn: 167170
* LoopVectorize: Do not vectorize loops with tiny constant trip counts.Nadav Rotem2012-10-311-0/+33
| | | | llvm-svn: 167101
* Add support for loops that don't start with Zero.Nadav Rotem2012-10-312-0/+84
| | | | | | | 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
* LoopVectorize: Add support for write-only loops when the write destination ↵Nadav Rotem2012-10-301-0/+26
| | | | | | | | is a single pointer. Speedup SciMark by 1% llvm-svn: 167035
* LoopVectorize: Fix a bug in the initialization of reduction variables. AND ↵Nadav Rotem2012-10-301-0/+1
| | | | | | | | needs to start at all-one while XOR, and OR need to start at zero. llvm-svn: 167032
* 1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to ↵Nadav Rotem2012-10-271-0/+62
| | | | | | | | | 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
* Refactor the VectorTargetTransformInfo interface.Nadav Rotem2012-10-261-1/+1
| | | | | | | | | | 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
* Move the target-specific tests, which require specific backends, to dirs ↵Nadav Rotem2012-10-263-1/+7
| | | | | | that only run if the target is present. llvm-svn: 166796
* Fix the cost-model test.Nadav Rotem2012-10-251-1/+1
| | | | llvm-svn: 166722
* Add the cpu model to the test.Nadav Rotem2012-10-251-1/+1
| | | | llvm-svn: 166718
* Add support for additional reduction variables: AND, OR, XOR.Nadav Rotem2012-10-251-0/+79
| | | | | | Patch by Paul Redmond <paul.redmond@intel.com>. llvm-svn: 166649
* Implement a basic cost model for vector and scalar instructions. Nadav Rotem2012-10-241-3/+1
| | | | llvm-svn: 166642
* LoopVectorizer: Add a basic cost model which uses the VTTI interface.Nadav Rotem2012-10-2410-9/+49
| | | | llvm-svn: 166620
* Use the AliasAnalysis isIdentifiedObj because it also understands mallocs ↵Nadav Rotem2012-10-231-0/+46
| | | | | | | | and c++ news. PR14158. llvm-svn: 166491
* Don't crash if the load/store pointer is not a GEP.Nadav Rotem2012-10-221-0/+57
| | | | | | Fix by Shivarama Rao <Shivarama.Rao@amd.com> llvm-svn: 166427
* Vectorizer: optimize the generation of selects. If the condition is uniform, ↵Nadav Rotem2012-10-221-0/+37
| | | | | | generate a scalar-cond select (i1 as selector). llvm-svn: 166409
* Fix a bug in the vectorization of wide load/store operations.Nadav Rotem2012-10-211-0/+30
| | | | | | | | 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
* Add support for reduction variables that do not start at zero.Nadav Rotem2012-10-211-4/+34
| | | | | | | | | | | | 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
* Vectorizer: fix a bug in the classification of induction/reduction phis.Nadav Rotem2012-10-211-0/+15
| | | | llvm-svn: 166384
* Fix an infinite loop in the loop-vectorizer.Nadav Rotem2012-10-201-0/+12
| | | | | | PR14134. llvm-svn: 166379
* Vectorize: teach cavVectorizeMemory to distinguish between A[i]+=x and ↵Nadav Rotem2012-10-202-0/+98
| | | | | | | | | 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
OpenPOWER on IntegriCloud