diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-10-18 23:47:22 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-10-18 23:47:22 +0000 |
commit | 38e98d5782b24b6cfcdd7651ebb4eff547cf2619 (patch) | |
tree | 4a2bc6c882d5279909f2362dabbde95b1bee3e67 /llvm/lib/Analysis/Loads.cpp | |
parent | 1f27f038494365f04d0aa44a6c5f2cef6e76a686 (diff) | |
download | bcm5719-llvm-38e98d5782b24b6cfcdd7651ebb4eff547cf2619.tar.gz bcm5719-llvm-38e98d5782b24b6cfcdd7651ebb4eff547cf2619.zip |
Rename 'TD' to 'DL' in this function as the argument is now a DataLayout
argument.
llvm-svn: 220151
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r-- | llvm/lib/Analysis/Loads.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index 13be270a852..5aa6068b56a 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -62,10 +62,10 @@ static bool AreEquivalentAddressValues(const Value *A, const Value *B) { /// This uses the pointee type to determine how many bytes need to be safe to /// load from the pointer. bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom, - unsigned Align, const DataLayout *TD) { + unsigned Align, const DataLayout *DL) { int64_t ByteOffset = 0; Value *Base = V; - Base = GetPointerBaseWithConstantOffset(V, ByteOffset, TD); + Base = GetPointerBaseWithConstantOffset(V, ByteOffset, DL); if (ByteOffset < 0) // out of bounds return false; @@ -86,17 +86,17 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom, } if (BaseType && BaseType->isSized()) { - if (TD && BaseAlign == 0) - BaseAlign = TD->getPrefTypeAlignment(BaseType); + if (DL && BaseAlign == 0) + BaseAlign = DL->getPrefTypeAlignment(BaseType); if (Align <= BaseAlign) { - if (!TD) + if (!DL) return true; // Loading directly from an alloca or global is OK. // Check if the load is within the bounds of the underlying object. PointerType *AddrTy = cast<PointerType>(V->getType()); - uint64_t LoadSize = TD->getTypeStoreSize(AddrTy->getElementType()); - if (ByteOffset + LoadSize <= TD->getTypeAllocSize(BaseType) && + uint64_t LoadSize = DL->getTypeStoreSize(AddrTy->getElementType()); + if (ByteOffset + LoadSize <= DL->getTypeAllocSize(BaseType) && (Align == 0 || (ByteOffset % Align) == 0)) return true; } |