summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-12-04 18:29:45 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-12-04 18:29:45 +0000
commita9020249400f65612fc9f1c0f5cfebe50a58ff85 (patch)
tree2be2e6b0e25a36998f84362eb2314aa1cbf07587 /lib
parent24d616e51f503d77fe9dca5904991292831b9132 (diff)
downloadllvm-a9020249400f65612fc9f1c0f5cfebe50a58ff85.tar.gz
llvm-a9020249400f65612fc9f1c0f5cfebe50a58ff85.tar.bz2
llvm-a9020249400f65612fc9f1c0f5cfebe50a58ff85.tar.xz
Merging r169084: into 3.2 release branch.
SROA: Avoid struct and array types early to avoid creating an overly large integer type. Fixes PR14465. Differential Revision: http://llvm-reviews.chandlerc.com/D148 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@169290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index ccc2f7a77b..062ec05342 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))