[patch] PR tree-optimizations/26969 (vectorizer)

Victor Kaplansky VICTORK@il.ibm.com
Wed Jun 7 21:26:00 GMT 2006


The testcase attached below ICEs when compiled with -funswitch-loops.
This happens because (vect_do_peeling_for_alignment) was designed in an
assumption that latch is empty. Thus it doesn't handle PHIs in latches.
(vect_analyze_loop_form) checks the latch is empty, but doesn't check that
list
of its PHIs is empty as well.

Ideally, I'd think, it would be nice to enhance loop peeling to handle
PHIs in latches.

This patch modify (vect_analyze_loop_form) to avoid vectorization of loops
with non-empty list of PHIs in the latch.

Bootstrapped and tested on the vectorizer testcases on powerpc-linux.

ok for mainline?

thanks,
-- Victor

:ADDPATCH SSA (vectorizer):

Changelog:
        PR tree-optimization/26969
        * tree-vect-analyze.c (vect_analyze_loop_form): Add check of latch
         witch an empty list of PHIs.

testsuite/Changelog:
        PR tree-optimizations/26969
        * gcc.dg/vect/vect.exp: Compile tests prefixed with
"unswitch-loops"
        with -funswitch-loops.
        * gcc.dg/vect/unswitch-loops-pr26969.c: New test.

(See attached file: pr26969.patch.txt)(See attached file:
unswitch-loops-pr26969.c)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr26969.patch.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060607/8b42d6a8/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unswitch-loops-pr26969.c
Type: application/octet-stream
Size: 292 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060607/8b42d6a8/attachment.obj>


More information about the Gcc-patches mailing list