[llvm-commits] [llvm] r169084 - in /llvm/trunk: lib/Transforms/Scalar/SROA.cpp test/Transforms/SROA/basictest.ll
Pawel Wodnicki
pawel at 32bitmicro.com
Tue Dec 4 10:37:26 PST 2012
On 12/1/2012 12:42 PM, Benjamin Kramer wrote:
>
> On 01.12.2012, at 12:53, Benjamin Kramer <benny.kra at googlemail.com> wrote:
>
>> Author: d0k
>> Date: Sat Dec 1 05:53:32 2012
>> New Revision: 169084
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=169084&view=rev
>> Log:
>> 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
>
> Chandler, can you approve this for 3.2? It's a low-risk crashfix that's also a regression from 3.1.
Committed revision 169290.
Pawel
>
> - Ben
>
>>
>> Modified:
>> llvm/trunk/lib/Transforms/Scalar/SROA.cpp
>> llvm/trunk/test/Transforms/SROA/basictest.ll
>>
>> Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=169084&r1=169083&r2=169084&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Sat Dec 1 05:53:32 2012
>> @@ -2164,6 +2164,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/trunk/test/Transforms/SROA/basictest.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SROA/basictest.ll?rev=169084&r1=169083&r2=169084&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/Transforms/SROA/basictest.ll (original)
>> +++ llvm/trunk/test/Transforms/SROA/basictest.ll Sat Dec 1 05:53:32 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
>> +}
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
More information about the llvm-commits
mailing list