Use 64bit arithmetic for calculating distance between pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2013-04-20 05:17:47 +00:00
parent abe64dc6f7
commit fbcaf59e33

View 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);
}