summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-07-18 18:34:21 +0000
committerNadav Rotem <nrotem@apple.com>2013-07-18 18:34:21 +0000
commitbb3398f0004fe0abd75fc637ed9838940429e960 (patch)
tree94734ed6934d4f72aa71f545858b27145a4d63fa /llvm/lib/Transforms
parentde2815a5f705d0b4dc86a4af992e2a10b772ef71 (diff)
downloadbcm5719-llvm-bb3398f0004fe0abd75fc637ed9838940429e960.tar.gz
bcm5719-llvm-bb3398f0004fe0abd75fc637ed9838940429e960.zip
Handle constants without going through SCEV.
llvm-svn: 186593
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 3629eeec173..f1da774ede5 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud