diff options
| author | Nadav Rotem <nrotem@apple.com> | 2012-12-26 19:08:17 +0000 |
|---|---|---|
| committer | Nadav Rotem <nrotem@apple.com> | 2012-12-26 19:08:17 +0000 |
| commit | 3f7c4f36bab1f9d8755218d1239ae3acd820ef0c (patch) | |
| tree | 998f39e16f5a5ff23781039719aea00059990b61 /llvm/lib/Transforms/Vectorize/LoopVectorize.h | |
| parent | 8d5f8dc485c0c5991bd6fe244ef0a58c28d5bf9e (diff) | |
| download | bcm5719-llvm-3f7c4f36bab1f9d8755218d1239ae3acd820ef0c.tar.gz bcm5719-llvm-3f7c4f36bab1f9d8755218d1239ae3acd820ef0c.zip | |
LoopVectorizer: Optimize the vectorization of consecutive memory access when the iteration step is -1
llvm-svn: 171114
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.h')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.h b/llvm/lib/Transforms/Vectorize/LoopVectorize.h index 0e5ecabec0f..38d62f1b373 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.h +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.h @@ -161,6 +161,9 @@ private: /// vectors of ones and zeros for the reduction code. Constant* getUniformVector(unsigned Val, Type* ScalarTy); + /// Generate a shuffle sequence that will reverse the vector Vec. + Value *reverseVector(Value *Vec); + typedef DenseMap<Value*, Value*> ValueMap; /// The original loop. @@ -331,7 +334,11 @@ public: /// when the last index of the GEP is the induction variable, or that the /// pointer itself is an induction variable. /// This check allows us to vectorize A[idx] into a wide load/store. - bool isConsecutivePtr(Value *Ptr); + /// Returns: + /// 0 - Stride is unknown or non consecutive. + /// 1 - Address is consecutive. + /// -1 - Address is consecutive, and decreasing. + int isConsecutivePtr(Value *Ptr); /// Returns true if the value V is uniform within the loop. bool isUniform(Value *V); |

