On Mon, 5 Feb 2007, Paolo Bonzini wrote: > > > As we also only vectorize innermost loops I believe doing a > > complete unrolling pass early will help in general (I pushed > > for this some time ago). > > > > Thoughts? > > It might also hurt, though, since we don't have a basic block vectorizer. > IIUC the vectorizer is able to turn > > for (i = 0; i < 4; i++) > v[i] = 0.0; > > into > > *(vector double *)v = (vector double){0.0, 0.0, 0.0, 0.0};
That's true. But we can not do constant propagation out of this (and the vectorizer leaves us with a lot of cruft which is only removed much later). The above case would also ask for an early vectorization pass if the loop was wrapped into another. Finding a good heuristic for which loops to completely unroll early is not easy, though for odd small numbers of iterations it is probably always profitable. Richard. -- Richard Guenther <[EMAIL PROTECTED]> Novell / SUSE Labs