llvm.org GIT mirror llvm / a902024
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 Pawel Wodnicki 6 years ago
2 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
21592159 AllocaPartitioning::const_use_iterator I,
21602160 AllocaPartitioning::const_use_iterator E) {
21612161 uint64_t SizeInBits = TD.getTypeSizeInBits(AllocaTy);
2162 // Don't create integer types larger than the maximum bitwidth.
2163 if (SizeInBits > IntegerType::MAX_INT_BITS)
2164 return false;
21622165
21632166 // Don't try to handle allocas with bit-padding.
21642167 if (SizeInBits != TD.getTypeStoreSizeInBits(AllocaTy))
11331133 ret void
11341134 ; CHECK: ret
11351135 }
1136
1137 define void @PR14465() {
1138 ; Ensure that we don't crash when analyzing a alloca larger than the maximum
1139 ; integer type width (MAX_INT_BITS) supported by llvm (1048576*32 > (1<<23)-1).
1140 ; CHECK: @PR14465
1141
1142 %stack = alloca [1048576 x i32], align 16
1143 ; CHECK: alloca [1048576 x i32]
1144 %cast = bitcast [1048576 x i32]* %stack to i8*
1145 call void @llvm.memset.p0i8.i64(i8* %cast, i8 -2, i64 4194304, i32 16, i1 false)
1146 ret void
1147 ; CHECK: ret
1148 }