[patch] [autovect] don't allow changing order of computation

Dorit Nuzman DORIT@il.ibm.com
Sat Aug 4 10:56:00 GMT 2007


Don't allow changing the order of the computation in the inner-loop during
outer-loop vectorization.

Rational: The vectorized inner-loop executes sequentially (each vectorized
inner-loop iteration contributes to VF outer-loop iterations in parallel).
Reductions in the inner-loop are therefore also computed in order (which is
why we don't need to worry if reassociation/fast-math etc allowed). There
were a few remaining bits that did change the order of the computation in
the inner-loop - the WIDEN_MULT_EVEN/ODD idioms and the widening
reduction-patterns DOT_PROD and WIDEN_SUM. So this patch makes sure we
don't use these idioms in the inner-loop when vectorizing the outer-loop.

This also makes this fix -
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00013.html - redundant.

Bootstrapped with vectorization enabled on powerpc64-linux and tested on
the vectorizer testcases on powerpc64-linux and i386-linux.
Committed to autovect-branch.

dorit

        * tree-vect-analyze.c (vect_mark_relevant): Revert last change.
        * tree-vectorize.c (supportable_widening_operation): Don't allow
        unrodered vectorization in the inner-loop when doing outer-loop
        vectorization.
        * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Don't allow
        in the inner-loop when doing outer-loop vectorization. Add
        documentation and printout.
        (vect_recog_widen_sum_pattern): Likewise.

        * gcc.dg/vect/vect-outer-4g.c: Add check for pattern not allowed.
Make
        check-loop in main unvectorizable.
        * gcc.dg/vect/vect-outer-4k.c: Likewise.
        * gcc.dg/vect/vect-outer-4l.c: Likewise.
        * gcc.dg/vect/vect-outer-4f.c: Likewise.

(See attached file: aug4.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: aug4.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070804/b31b0882/attachment.txt>


More information about the Gcc-patches mailing list