diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-07-18 18:34:21 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-07-18 18:34:21 +0000 |
commit | 39f59f4d95de11c3c39bf6753a555ac32cacf7b7 (patch) | |
tree | 7c91cc42287039cd54dc9ef8b312dc0d043dfd9c /lib/Transforms | |
parent | dfacdd04cd2dd3b474fcabc5497255548f5506d5 (diff) |
Handle constants without going through SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 3629eeec173..f1da774ede5 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1033,6 +1033,12 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) { if (GepA && GepA->getPointerOperand() == PtrB) return false; + ConstantInt *CA = dyn_cast<ConstantInt>(PtrA); + ConstantInt *CB = dyn_cast<ConstantInt>(PtrB); + if (CA && CB) { + return (CA->getSExtValue() + Sz == CB->getSExtValue()); + } + // Calculate the distance. const SCEV *PtrSCEVA = SE->getSCEV(PtrA); const SCEV *PtrSCEVB = SE->getSCEV(PtrB); |