[llvm] r182656 - LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.

Nadav Rotem nrotem at apple.com
Fri May 24 11:11:00 PDT 2013


LGTM. 

On May 24, 2013, at 11:09 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:

> 
> On 24.05.2013, at 20:05, Benjamin Kramer <benny.kra at googlemail.com> wrote:
> 
>> Author: d0k
>> Date: Fri May 24 13:05:35 2013
>> New Revision: 182656
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=182656&view=rev
>> Log:
>> LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.
>> 
>> Fixes PR16139.
> 
> This unbreaks compiling erlang at -O3, making it a good candidate for 3.3.
> 
> - Ben
> 
>> 
>> Modified:
>>   llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
>>   llvm/trunk/test/Transforms/LoopVectorize/lcssa-crash.ll
>> 
>> Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=182656&r1=182655&r2=182656&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Fri May 24 13:05:35 2013
>> @@ -2428,7 +2428,10 @@ bool LoopVectorizationLegality::canVecto
>> }
>> 
>> bool LoopVectorizationLegality::canVectorize() {
>> -  assert(TheLoop->getLoopPreheader() && "No preheader!!");
>> +  // We must have a loop in canonical form. Loops with indirectbr in them cannot
>> +  // be canonicalized.
>> +  if (!TheLoop->getLoopPreheader())
>> +    return false;
>> 
>>  // We can only vectorize innermost loops.
>>  if (TheLoop->getSubLoopsVector().size())
>> 
>> Modified: llvm/trunk/test/Transforms/LoopVectorize/lcssa-crash.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/lcssa-crash.ll?rev=182656&r1=182655&r2=182656&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/Transforms/LoopVectorize/lcssa-crash.ll (original)
>> +++ llvm/trunk/test/Transforms/LoopVectorize/lcssa-crash.ll Fri May 24 13:05:35 2013
>> @@ -27,3 +27,14 @@ for.end.i.i.i:
>>  unreachable
>> }
>> 
>> +; PR16139
>> +define void @test2(i8* %x) {
>> +entry:
>> +  indirectbr i8* %x, [ label %L0, label %L1 ]
>> +
>> +L0:
>> +  br label %L0
>> +
>> +L1:
>> +  ret void
>> +}
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130524/5b2620bf/attachment.html>


More information about the llvm-commits mailing list