Use 64bit arithmetic for calculating distance between pointers.
authorNadav Rotem <nrotem@apple.com>
Sat, 20 Apr 2013 05:17:47 +0000 (05:17 +0000)
committerNadav Rotem <nrotem@apple.com>
Sat, 20 Apr 2013 05:17:47 +0000 (05:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179927 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/VecUtils.cpp

index a69646336c8a057778cb12fb6878b80ca8852f46..e1ff3d91e16f3a4a999f4b5b9fcff5cbc595f168 100644 (file)
@@ -94,11 +94,11 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
   // Non constant distance.
   if (!ConstOffSCEV) return false;
 
-  unsigned Offset = ConstOffSCEV->getValue()->getSExtValue();
+  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 same as the offset.
-  unsigned Sz = DL->getTypeStoreSize(Ty);
+  int64_t Sz = DL->getTypeStoreSize(Ty);
   return ((-Offset) == Sz);
 }