This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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)

Attachment: pr26969.patch.txt
Description: Text document

Attachment: unswitch-loops-pr26969.c
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]