[llvm] r186593 - Handle constants without going through SCEV.
Nadav Rotem
nrotem at apple.com
Thu Jul 18 11:34:21 PDT 2013
Author: nadav
Date: Thu Jul 18 13:34:21 2013
New Revision: 186593
URL: http://llvm.org/viewvc/llvm-project?rev=186593&view=rev
Log:
Handle constants without going through SCEV.
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=186593&r1=186592&r2=186593&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Thu Jul 18 13:34:21 2013
@@ -1033,6 +1033,12 @@ bool BoUpSLP::isConsecutiveAccess(Value
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);
More information about the llvm-commits
mailing list