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

Chandler Carruth chandlerc at google.com
Fri Jan 4 10:18:12 PST 2013


On Fri, Jan 4, 2013 at 10:09 AM, Nadav Rotem <nrotem at apple.com> wrote:

> 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.
>

Also, we discussed a bunch of ideas for how to actually get a heuristic
based vectorizer that can be tuned between O2 and O3 rather than just being
off with one and on with another.

Hopefully we'll be able to make progress on those ideas -- I'm personally
interested in finding a balance that can still vectorize the loops that are
clearly profitable, but doesn't have the code size and performance penalty
for code that doesn't directly benefit from it.


> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130104/379b56c1/attachment.html>


More information about the llvm-commits mailing list