diff options
author | dim <dim@FreeBSD.org> | 2012-12-22 14:58:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-22 14:58:30 +0000 |
commit | 0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e (patch) | |
tree | c074bb56c422dea536a85cc2d80fd620bb6af08e /lib/Transforms/Scalar/SROA.cpp | |
parent | 6de2c08bc400b4aca9fb46684e8bdb56eed9b09f (diff) | |
download | FreeBSD-src-0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e.zip FreeBSD-src-0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e.tar.gz |
Vendor import of llvm tags/RELEASE_32/final r170710 (effectively, 3.2
release):
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_32/final@170710
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index ccc2f7a..2d518f7 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -2160,6 +2160,9 @@ static bool isIntegerWideningViable(const DataLayout &TD, AllocaPartitioning::const_use_iterator I, AllocaPartitioning::const_use_iterator E) { uint64_t SizeInBits = TD.getTypeSizeInBits(AllocaTy); + // Don't create integer types larger than the maximum bitwidth. + if (SizeInBits > IntegerType::MAX_INT_BITS) + return false; // Don't try to handle allocas with bit-padding. if (SizeInBits != TD.getTypeStoreSizeInBits(AllocaTy)) @@ -2198,7 +2201,7 @@ static bool isIntegerWideningViable(const DataLayout &TD, if (RelBegin == 0 && RelEnd == Size) WholeAllocaOp = true; if (IntegerType *ITy = dyn_cast<IntegerType>(LI->getType())) { - if (ITy->getBitWidth() < TD.getTypeStoreSize(ITy)) + if (ITy->getBitWidth() < TD.getTypeStoreSizeInBits(ITy)) return false; continue; } @@ -2214,7 +2217,7 @@ static bool isIntegerWideningViable(const DataLayout &TD, if (RelBegin == 0 && RelEnd == Size) WholeAllocaOp = true; if (IntegerType *ITy = dyn_cast<IntegerType>(ValueTy)) { - if (ITy->getBitWidth() < TD.getTypeStoreSize(ITy)) + if (ITy->getBitWidth() < TD.getTypeStoreSizeInBits(ITy)) return false; continue; } |