[llvm-branch-commits] [llvm-branch] r169290 - in /llvm/branches/release_32: ./ lib/Transforms/Scalar/SROA.cpp test/Transforms/SROA/basictest.ll
Pawel Wodnicki
pawel at 32bitmicro.com
Tue Dec 4 10:29:45 PST 2012
Author: pawel
Date: Tue Dec 4 12:29:45 2012
New Revision: 169290
URL: http://llvm.org/viewvc/llvm-project?rev=169290&view=rev
Log:
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
Modified:
llvm/branches/release_32/ (props changed)
llvm/branches/release_32/lib/Transforms/Scalar/SROA.cpp
llvm/branches/release_32/test/Transforms/SROA/basictest.ll
Propchange: llvm/branches/release_32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 4 12:29:45 2012
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,167718-167719,167731,167737,167743,167750,167784,167811,167817,167855,167860-167864,167875,167912,167942,167948,167966,168001,168035,168181,168186,168189,168196-168198,168227,168280,168291,168316,168319-168320,168346,168352,168354,168361,168364,168512,168622,168711,168765,168799,168837,168921
+/llvm/trunk:155241,167718-167719,167731,167737,167743,167750,167784,167811,167817,167855,167860-167864,167875,167912,167942,167948,167966,168001,168035,168181,168186,168189,168196-168198,168227,168280,168291,168316,168319-168320,168346,168352,168354,168361,168364,168512,168622,168711,168765,168799,168837,168921,169084
Modified: llvm/branches/release_32/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Transforms/Scalar/SROA.cpp?rev=169290&r1=169289&r2=169290&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/branches/release_32/lib/Transforms/Scalar/SROA.cpp Tue Dec 4 12:29:45 2012
@@ -2160,6 +2160,9 @@
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))
Modified: llvm/branches/release_32/test/Transforms/SROA/basictest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/test/Transforms/SROA/basictest.ll?rev=169290&r1=169289&r2=169290&view=diff
==============================================================================
--- llvm/branches/release_32/test/Transforms/SROA/basictest.ll (original)
+++ llvm/branches/release_32/test/Transforms/SROA/basictest.ll Tue Dec 4 12:29:45 2012
@@ -1134,3 +1134,16 @@
ret void
; CHECK: ret
}
+
+define void @PR14465() {
+; Ensure that we don't crash when analyzing a alloca larger than the maximum
+; integer type width (MAX_INT_BITS) supported by llvm (1048576*32 > (1<<23)-1).
+; CHECK: @PR14465
+
+ %stack = alloca [1048576 x i32], align 16
+; CHECK: alloca [1048576 x i32]
+ %cast = bitcast [1048576 x i32]* %stack to i8*
+ call void @llvm.memset.p0i8.i64(i8* %cast, i8 -2, i64 4194304, i32 16, i1 false)
+ ret void
+; CHECK: ret
+}
More information about the llvm-branch-commits
mailing list