summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-07-16 22:57:06 +0000
committerNadav Rotem <nrotem@apple.com>2013-07-16 22:57:06 +0000
commitd2e8c4cdea7ba95ddc603be923f56da8176c506a (patch)
tree54d5ce7ad5af29600a58bd1e03f69815e50cefdd /llvm/lib/Transforms
parent8f924f3891dddd750d63ab191afc35b57572a956 (diff)
downloadbcm5719-llvm-d2e8c4cdea7ba95ddc603be923f56da8176c506a.tar.gz
bcm5719-llvm-d2e8c4cdea7ba95ddc603be923f56da8176c506a.zip
flip the scev minus direction to simplify the code.
llvm-svn: 186466
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index c1e811126d6..572f3436804 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1004,7 +1004,7 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
// Calculate the distance.
const SCEV *PtrSCEVA = SE->getSCEV(PtrA);
const SCEV *PtrSCEVB = SE->getSCEV(PtrB);
- const SCEV *OffsetSCEV = SE->getMinusSCEV(PtrSCEVA, PtrSCEVB);
+ const SCEV *OffsetSCEV = SE->getMinusSCEV(PtrSCEVB, PtrSCEVA);
const SCEVConstant *ConstOffSCEV = dyn_cast<SCEVConstant>(OffsetSCEV);
// Non constant distance.
@@ -1013,10 +1013,10 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
int64_t Offset = ConstOffSCEV->getValue()->getSExtValue();
Type *Ty = cast<PointerType>(PtrA->getType())->getElementType();
- // The Instructions are connsecutive if the size of the first load/store is
+ // The Instructions are consecutive if the size of the first load/store is
// the same as the offset.
int64_t Sz = DL->getTypeStoreSize(Ty);
- return ((-Offset) == Sz);
+ return (Offset == Sz);
}
Value *BoUpSLP::getSinkBarrier(Instruction *Src, Instruction *Dst) {
OpenPOWER on IntegriCloud