diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-16 22:43:16 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-16 22:43:16 +0000 |
commit | 4b28ee208895d2a9c98b9e63d0c39985500e9291 (patch) | |
tree | 29052e62c346f857fc550cf2746378bff3d418f7 /include | |
parent | 0c190ad93f12027ec158eb2b0558d4ca375ecc39 (diff) | |
download | llvm-4b28ee208895d2a9c98b9e63d0c39985500e9291.tar.gz llvm-4b28ee208895d2a9c98b9e63d0c39985500e9291.tar.bz2 llvm-4b28ee208895d2a9c98b9e63d0c39985500e9291.tar.xz |
MemCpyOptimizer: Use max legal int size instead of pointer size
If there are no legal integers, assume 1 byte.
This makes more sense than using the pointer size as
a guess for the maximum GPR width.
It is conceivable to want to use some 64-bit pointers
on a target where 64-bit integers aren't legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/DataLayout.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index 25f7569e24..10630a2620 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -369,6 +369,17 @@ public: /// least as big as Width bits. Type *getSmallestLegalIntType(LLVMContext &C, unsigned Width = 0) const; + /// getLargestLegalIntType - Return the largest legal integer type, or null if + /// none are set. + Type *getLargestLegalIntType(LLVMContext &C) const { + unsigned LargestSize = getLargestLegalIntTypeSize(); + return (LargestSize == 0) ? 0 : Type::getIntNTy(C, LargestSize); + } + + /// getLargestLegalIntType - Return the size of largest legal integer type + /// size, or 0 if none are set. + unsigned getLargestLegalIntTypeSize() const; + /// getIndexedOffset - return the offset from the beginning of the type for /// the specified indices. This is used to implement getelementptr. uint64_t getIndexedOffset(Type *Ty, ArrayRef<Value *> Indices) const; |