Re: Helping out the Vectorizer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/14/07, Gordan Bobic <gordan@xxxxxxxxxx> wrote:
> On Tue, 14 Aug 2007, Daniel Berlin wrote:
>
> >> I'm trying to get more of my code to vectorize, but very few of the loops
> >> do. ICC (sorry for mentioning it, don't mean to offend anyone) manages to
> >> vectorize all of the loops in my code, so it is doable (and succeeding
> >> seems to yield a speed-up of 5-10x!).
> >>
> >> Is there a way to help out the vectorizer with pragmas and suchlike, to
> >> resolve possible misperceived vector dependence issues?
> >>
> >
> > For starters, it would help to tell us which version of GCC you are
> > trying with.
>
> 4.1.0 and 4.2.1 both produce pretty much identical results.
>
The current mainline does, however, vectorize one of the loops (the
one on line 15).

 > Second, your code doesn't compile as you've written it, so i can't
> > diagnose more without you fixing it :)
>
> OK, attached a compilable version. Compiler says:
>
> test.cxx:15: note: not vectorized: can't determine dependence between
> this_10->D.2134.Curve[i.0_30] and this_10->D.2134.Curve[i.0_30]
> test.cxx:23: note: not vectorized: unsupported use in stmt.
> test.cxx:32: note: not vectorized: unsupported use in stmt.
>
> > Third, even with some modifications to make it compile, your class
> > isn't used, so we wouldn't bother to compile it.
>
> It compiles now, as per the attached code file. I would have thought the
> code to demonstrate that a one liner loop doesn't vectorize should be
> enough to diagnose a problem with the vectorizer.

Not really, because there are millions of reasons the vectorizer could
decide it can't or won't (due to profitability) vectorize something,
so usually the actual code in question is needed.

In this case, 4.3 will vectorize the loop on 15.

The others are just too complex of reduction patterns right now, it looks like.

Feel free to file a missed optimization bug on it :)

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux