[llvm-commits] [llvm] r171471 - /llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp

Nadav Rotem nrotem at apple.com
Fri Jan 4 10:09:39 PST 2013


Hi Hal, 

I spoke with chandler last night and he said that he ran comprehensive testing and he found two interesting things:

1. When vectorizing everything with O2, the code gets 3% bigger, and as a result slower.  When it works it works really well, but most vectorizable loops are in the cold path. 
2. When disabling the pre-loop for loops that require: runtime checks, odd number of iterations, etc. Then the loop vectorizer does not catch much. 

At the moment it looks like it is better to mimic the gcc behavior and enable the loop vectorizer only on O3.

Nadav


On Jan 4, 2013, at 10:04 AM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
>> From: "Nadav Rotem" <nrotem at apple.com>
>> To: llvm-commits at cs.uiuc.edu
>> Sent: Friday, January 4, 2013 11:57:44 AM
>> Subject: [llvm-commits] [llvm] r171471 -	/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>> 
>> Author: nadav
>> Date: Fri Jan  4 11:57:44 2013
>> New Revision: 171471
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=171471&view=rev
>> Log:
>> Move the loop vectorizer from O2 to O3. It looks like the increase in
>> code size actually hurts the performance on many programs.
> 
> Can you be specific about what code size increase? (runtime checks, if conversion, unrolling)? And what does this have to do with moving the vectorizer from -02 to -O3? To be clear, I don't object to the change (enabling autovectorization at -O3 seems pretty standard these days).
> 
> Thanks again,
> Hal
> 
>> 
>> Modified:
>>    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>> 
>> Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=171471&r1=171470&r2=171471&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
>> +++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Jan  4
>> 11:57:44 2013
>> @@ -187,7 +187,7 @@
>>   MPM.add(createLoopIdiomPass());             // Recognize idioms
>>   like memset.
>>   MPM.add(createLoopDeletionPass());          // Delete dead loops
>> 
>> -  if (LoopVectorize && OptLevel > 1)
>> +  if (LoopVectorize && OptLevel > 2)
>>     MPM.add(createLoopVectorizePass());
>> 
>>   if (!DisableUnrollLoops)
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> 
> -- 
> Hal Finkel
> Postdoctoral Appointee
> Leadership Computing Facility
> Argonne National Laboratory




More information about the llvm-commits mailing list