"Daniel Berlin" <[EMAIL PROTECTED]> wrote on 17/06/2007 18:18:19:

...
>
> The whole purpose of SLP was to enable straight line code
> vectorization outside of loops.

I wouldn't say that's the whole purpose of SLP. I think the purpose and
beauty of SLP is that it's a simple algorithm that makes vectorization
(including vectorization of loops) easier by removing the need to prove all
kinds of properties about the loop as a whole, as well as the need to
transform loops to make them vectorizable. The fact that this scheme also
works out of loops is a neat property because it makes loop-vectorization a
special case of SLP. However, as far as I know (also from talking with the
SLP authors) pretty much all the opportunities they had found at the time
were in loops. Also, a lot of the SLP based work that followed it focused
on loops, and analysis to determine by how much to unroll loops in order to
accommodate SLP. So, in reality, as always, there are no free meals - you
often really have to compensate for the simple loop-ignorant SLP analysis
by doing a lot of loop-level analysis and transformations before hand.

While it cannot replace the classic SLP algorithm out-of-loops (e.g. for
completely unrolled loops), doing SLP in loops actually makes a lot of
sense, IMHO. It lets us leverage already existing infrastructure (the slp
patch recently committed to autovect-branch is really not big), and opens
up a lot of opportunities we couldn't vectorize before (partially unrolled
loops, partially vectorizable loops, accesses to consecutive struct fields,
and in the future also permutations), while taking advantage of the
loop-context when it helps you do things more efficiently. In any case,
we'll have to have a much better cost model before we start packing random
sequences of stmts out of loops.

> Simply because you can't find cases in SPEC2000 doesn't mean it's not
useful.

I don't know where you're taking this from. SPEC2000 is really not so
interesting vectorization wise, inside or outside loops.

dorit

Reply via email to