Commit Graph

198 Commits

Author SHA1 Message Date
James Molloy
3a168569fc [LAA] Correctly return a half-open range in expandBounds
This is a latent bug that's been hanging around for a while. For a loop-invariant
pointer, expandBounds would return the range {Ptr, Ptr}, but this was interpreted
as a half-open range, not a closed range. So we ended up planting incorrect
bounds checks. Even worse, they were tautological, so we ended up incorrectly
executing the optimized loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 09:24:26 +00:00
Michael Kuperstein
70d8785561 [SLP] Revert everything that has to do with memory access sorting.
This reverts r293386, r294027, r294029 and r296411.

Turns out the SLP tree isn't actually a "tree" and we don't handle
accessing the same packet of loads in several different orders well,
causing miscompiles.

Revert until we can fix this properly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 18:59:07 +00:00
Amjad Aboud
8cd8473e96 [SLP] Fixed non-deterministic behavior in Loop Vectorizer.
Differential Revision: https://reviews.llvm.org/D30638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 05:09:10 +00:00
Michael Kuperstein
48a77b7523 [SLP] Revert r296863 due to miscompiles.
Details and reproducer are on the email thread for r296863.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 23:54:51 +00:00
Mohammad Shahid
48b84df15d [SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available
for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.
The fix is to compute the mask for out of order memory accesses while building the vectorizable tree
instead of actual vectorization of vectorizable tree.It also needs to recompute the proper Lane for
external use of vectorizable scalars based on shuffle mask.

Reviewers: mkuper

Differential Revision: https://reviews.llvm.org/D30159

Change-Id: Ide8773ce0ad3562f3cf4d1a0ad0f487e2f60ce5d

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 10:02:47 +00:00
Hans Wennborg
4024478081 Revert r296575 "[SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available"
It caused miscompiles, e.g. in Chromium (PR32109).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 18:57:16 +00:00
Mohammad Shahid
b2ec2bd1f6 [SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available
for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.
The fix is to compute the mask for out of order memory accesses while building the vectorizable tree
instead of actual vectorization of vectorizable tree.

Reviewers: mkuper

Differential Revision: https://reviews.llvm.org/D30159

Change-Id: Id1e287f073fa4959713ba545fa4254db5da8b40d

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 03:51:54 +00:00
Michael Kuperstein
3ee59b3779 [SLP] Load sorting should not try to sort things that aren't loads.
We may get a VL where the first element is a load, but the others
aren't. Trying to sort such VLs can only lead to sorrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 23:18:11 +00:00
Adam Nemet
d7e57f0502 [LAA] Remove unused LoopAccessReport
The need for this removed when I converted everything to use the opt-remark
classes directly with the streaming interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:17:36 +00:00
Matthew Simpson
b82f5b8ba8 [LAA] Remove unused code (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 20:46:52 +00:00
Dorit Nuzman
7078fa3567 [LV/LoopAccess] Check statically if an unknown dependence distance can be
proven larger than the loop-count

This fixes PR31098: Try to resolve statically data-dependences whose
compile-time-unknown distance can be proven larger than the loop-count, 
instead of resorting to runtime dependence checking (which are not always 
possible).

For vectorization it is sufficient to prove that the dependence distance 
is >= VF; But in some cases we can prune unknown dependence distances early,
and even before selecting the VF, and without a runtime test, by comparing 
the distance against the loop iteration count. Since the vectorized code 
will be executed only if LoopCount >= VF, proving distance >= LoopCount 
also guarantees that distance >= VF. This check is also equivalent to the 
Strong SIV Test.

Reviewers: mkuper, anemet, sanjoy

Differential Revision: https://reviews.llvm.org/D28044



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 09:32:53 +00:00
Michael Kuperstein
55c04887b4 [SLP] Make sortMemAccesses explicitly return an error. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-03 19:32:50 +00:00
Michael Kuperstein
dce4987e9b [SLP] Use SCEV to sort memory accesses.
This generalizes memory access sorting to use differences between SCEVs,
instead of relying on constant offsets. That allows us to properly do
SLP vectorization of non-sequentially ordered loads within loops bodies.

Differential Revision: https://reviews.llvm.org/D29425


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-03 19:09:45 +00:00
Mohammad Shahid
13e3a7f7a3 [SLP] Vectorize loads of consecutive memory accesses, accessed in non-consecutive (jumbled) way.
The jumbled scalar loads will be sorted while building the tree and these accesses will be marked to generate shufflevector after the vectorized load with proper mask.

Reviewers: hfinkel, mssimpso, mkuper

Differential Revision: https://reviews.llvm.org/D26905

Change-Id: I9c0c8e6f91a00076a7ee1465440a3f6ae092f7ad

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-28 17:59:44 +00:00
Chandler Carruth
c68d25fb58 [PM] Separate the LoopAnalysisManager from the LoopPassManager and move
the latter to the Transforms library.

While the loop PM uses an analysis to form the IR units, the current
plan is to have the PM itself establish and enforce both loop simplified
form and LCSSA. This would be a layering violation in the analysis
library.

Fundamentally, the idea behind the loop PM is to *transform* loops in
addition to running passes over them, so it really seemed like the most
natural place to sink this was into the transforms library.

We can't just move *everything* because we also have loop analyses that
rely on a subset of the invariants. So this patch splits the the loop
infrastructure into the analysis management that has to be part of the
analysis library, and the transform-aware pass manager.

This also required splitting the loop analyses' printer passes out to
the transforms library, which makes sense to me as running these will
transform the code into LCSSA in theory.

I haven't split the unittest though because testing one component
without the other seems nearly intractable.

Differential Revision: https://reviews.llvm.org/D28452

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:43:56 +00:00
Chandler Carruth
d27a39a962 [PM] Rewrite the loop pass manager to use a worklist and augmented run
arguments much like the CGSCC pass manager.

This is a major redesign following the pattern establish for the CGSCC layer to
support updates to the set of loops during the traversal of the loop nest and
to support invalidation of analyses.

An additional significant burden in the loop PM is that so many passes require
access to a large number of function analyses. Manually ensuring these are
cached, available, and preserved has been a long-standing burden in LLVM even
with the help of the automatic scheduling in the old pass manager. And it made
the new pass manager extremely unweildy. With this design, we can package the
common analyses up while in a function pass and make them immediately available
to all the loop passes. While in some cases this is unnecessary, I think the
simplicity afforded is worth it.

This does not (yet) address loop simplified form or LCSSA form, but those are
the next things on my radar and I have a clear plan for them.

While the patch is very large, most of it is either mechanically updating loop
passes to the new API or the new testing for the loop PM. The code for it is
reasonably compact.

I have not yet updated all of the loop passes to correctly leverage the update
mechanisms demonstrated in the unittests. I'll do that in follow-up patches
along with improved FileCheck tests for those passes that ensure things work in
more realistic scenarios. In many cases, there isn't much we can do with these
until the loop simplified form and LCSSA form are in place.

Differential Revision: https://reviews.llvm.org/D28292

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 06:23:21 +00:00
Keno Fischer
99ca52276f [LAA] Prevent invalid IR for loop-invariant bound in loop body
Summary:
If LAA expands a bound that is loop invariant, but not hoisted out
of the loop body, it used to use that value anyway, causing a
non-domination error, because the memcheck block is of course not
dominated by the scalar loop body. Detect this situation and expand
the SCEV expression instead.

Fixes PR31251

Reviewers: anemet
Subscribers: mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D27397

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 21:25:03 +00:00
Eugene Zelenko
c02caf5200 Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 17:48:10 +00:00
Chandler Carruth
33d568124e [PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

Differential Revision: https://reviews.llvm.org/D27031

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:53:26 +00:00
Adam Nemet
858cc931c4 [LAA, LV] Port to new streaming interface for opt remarks. Update LV
(Recommit after making sure IsVerbose gets properly initialized in
DiagnosticInfoOptimizationBase.  See previous commit that takes care of
this.)

OptimizationRemarkAnalysis directly takes the role of the report that is
generated by LAA.

Then we need the magic to be able to turn an LAA remark into an LV
remark.  This is done via a new OptimizationRemark ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 00:01:30 +00:00
Adam Nemet
a9b1465978 Revert "[LAA, LV] Port to new streaming interface for opt remarks. Update LV"
This reverts commit r282758.

There are some clang failures I haven't seen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 20:17:37 +00:00
Adam Nemet
07beb3c041 [LAA, LV] Port to new streaming interface for opt remarks. Update LV
OptimizationRemarkAnalysis directly takes the role of the report that is
generated by LAA.

Then we need the magic to be able to turn an LAA remark into an LV
remark.  This is done via a new OptimizationRemark ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 20:12:18 +00:00
Adam Nemet
e555d1bef7 [LAA] Rename emitAnalysis to recordAnalys. NFC
Ever since LAA was split out into an analysis on its own, this function
stopped emitting the report directly.  Instead it stores it to be
retrieved by the client which can then emit it as its own report
(e.g. -Rpass-analysis=loop-vectorize).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 00:58:36 +00:00
Adam Nemet
860a9f5ba8 [LV] When reporting about a specific instruction without debug location use loop's
This can occur for example if some optimization drops the debug location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 03:14:20 +00:00
Elena Demikhovsky
305b3f3b5a [Loop Vectorizer] Consecutive memory access - fixed and simplified
Amended consecutive memory access detection in Loop Vectorizer.
Load/Store were not handled properly without preceding GEP instruction.

Differential Revision: https://reviews.llvm.org/D20789



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 13:56:08 +00:00
Chad Rosier
cfe0cf017c Fix indent. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 18:37:52 +00:00
Elena Demikhovsky
1b2a8500af [Loop Vectorizer] Fixed memory confilict checks.
Fixed a bug in run-time checks for possible memory conflicts inside loop.
The bug is in Low <-> High boundaries calculation. The High boundary should be calculated as "last memory access pointer + element size".

Differential revision: https://reviews.llvm.org/D23176



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 08:53:53 +00:00
David Majnemer
ac0eb3d821 Use the range variant of transform instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 04:32:42 +00:00
Sean Silva
a4f9d70f9b Consistently use LoopAnalysisManager
One exception here is LoopInfo which must forward-declare it (because
the typedef is in LoopPassManager.h which depends on LoopInfo).

Also, some includes for LoopPassManager.h were needed since that file
provides the typedef.

Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:52 +00:00
Sean Silva
20b343c051 Consistently use FunctionAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:15 +00:00
Michael Kuperstein
e788186982 [LV, X86] Be more optimistic about vectorizing shifts.
Shifts with a uniform but non-constant count were considered very expensive to
vectorize, because the splat of the uniform count and the shift would tend to
appear in different blocks. That made the splat invisible to ISel, and we'd
scalarize the shift at codegen time.

Since r201655, CodeGenPrepare sinks those splats to be next to their use, and we
are able to select the appropriate vector shifts. This updates the cost model to
to take this into account by making shifts by a uniform cheap again.

Differential Revision: https://reviews.llvm.org/D23049


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 22:48:03 +00:00
Adam Nemet
957976efe6 [OptDiag,LV] Add hotness attribute to analysis remarks
The earlier change added hotness attribute to missed-optimization
remarks.  This follows up with the analysis remarks (the ones explaining
the reason for the missed optimization).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:44:26 +00:00
Adam Nemet
81c98a7118 [LAA] Don't hold on to DominatorTree in the analysis result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 22:36:35 +00:00
Adam Nemet
e12bf89766 [LAA] Don't hold on to TargetLibraryInfo in the analysis result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 22:36:27 +00:00
Adam Nemet
f5d4047fea [LAA] Don't hold on to DataLayout in the analysis result
In fact, don't even pass this to the ctor since we can get it from the
module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 22:18:51 +00:00
Adam Nemet
703303a42c [LAA] Don't hold on to LoopInfo in the analysis result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 22:18:48 +00:00
Adam Nemet
2ba3aa2758 [LAA] Don't hold on to AliasAnalysis in the analysis result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 21:39:09 +00:00
David Majnemer
7615994d12 [LoopAccessAnalysis] Some minor cleanups
Use range-base for loops.
Use auto when appropriate.

No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-12 20:31:46 +00:00
Xinliang David Li
fd5a3b4bf8 [PM] name the new PM LAA class LoopAccessAnalysis (LAA) /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08 21:21:44 +00:00
Xinliang David Li
e042fe59dc Rename LoopAccessAnalysis to LoopAccessLegacyAnalysis /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08 20:55:26 +00:00
David Majnemer
a609ccd0b5 [LoopAccessAnalysis] Fix an integer overflow
We were inappropriately using 32-bit types to account for quantities
that can be far larger.

Fixed in PR28443.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 06:24:36 +00:00
Sean Silva
aa13ea4ca0 [PM] Avoid getResult on a higher level in LoopAccessAnalysis
Note that require<domtree> and require<loops> aren't needed because they
come in implicitly via the loop pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 01:01:53 +00:00
Xinliang David Li
10b22c8894 [PM] Port LoopAccessInfo analysis to new PM
It is implemented as a LoopAnalysis pass as 
discussed and agreed upon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 21:18:40 +00:00
Xinliang David Li
6adce0835f [PM] refactor LoopAccessInfo code part-2
Differential Revision: http://reviews.llvm.org/D21636




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 05:59:55 +00:00
Adam Nemet
0954e3ab0f [LAA] Fix alphabetical sorting of headers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 00:09:02 +00:00
Elena Demikhovsky
f7282f8ee5 Reverted patch 273864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 10:01:06 +00:00
Elena Demikhovsky
1abadbff39 Fixed consecutive memory access detection in Loop Vectorizer.
It did not handle correctly cases without GEP.

The following loop wasn't vectorized:

for (int i=0; i<len; i++)

  *to++ = *from++;

I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.

Re-commit rL273257 - revision: http://reviews.llvm.org/D20789



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 11:19:23 +00:00
Xinliang David Li
42fe7e4c85 [PM]: LoopAccessInfo simple refactoring
To make definition of mov ctors easier.
Differential Revision: http://reviews.llvm.org/D21563



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 23:20:59 +00:00
Elena Demikhovsky
6f247766ed reverted the prev commit due to assertion failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 12:10:11 +00:00
Elena Demikhovsky
8ca9d2a8ad Fixed consecutive memory access detection in Loop Vectorizer.
It did not handle correctly cases without GEP.

The following loop wasn't vectorized:

for (int i=0; i<len; i++)
  *to++ = *from++;

I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.

Differential revision: http://reviews.llvm.org/D20789



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 11:32:01 +00:00