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]

[lno][patch]Vectorizer loop versioning for alignment


This patch uses loop versioning to vectorize loops with data references 
that may or may
not be properly aligned.  Two versions of a loop are generated.  One 
version is vectorized
and one is not.  A condition block is generated to test the alignment of 
the data references
in question and direct flow to the vectorized or non-vectorized version of 
the loop as appropriate.

testing on ppc
bootstrapped
SPEC (8 new loops vectorized in SPEC int, 2 new loops in SPEC fp)
gcc.dg/vect (vect-33.c, vect-44.c, vect48.c now vectorized)

Keith.


Changelog:

        * tree-vectorizer.h (struct _loop_vec_info): Add fields ptr_mask,
        may_misalign_stmts, and num_blocks
        * tree-vectorizer.c (vect_compute_data_refs_alignment): Return 
bool
        so caller knows when no vectorization is possible.
        (vect_compute_data_ref_alignment): Return bool and rearrange code
        so false returns, no vectorization possible, are performed first.
        (vect_analyze_data_refs): 
        (vect_create_index_for_array_ref): replaced with
        vect_create_index_for_vector_ref.
        (vect_create_addr_base_for_vector_ref): New, contains code from
        vect_create_data_ref so that it may be used by that procedure and
        by vect_create_cond_for_align_checks.
        (vect_create_cond_for_align_checks): New
        (new_loop_vec_info): initialize added _loop_vec_info fields.
        (destroy_loop_vec_info): Use/clear added _loop_vec_info fields.
        (vect_create_data_ref): Changed to use 
vect_create_index_for_vector_ref
        and vect_create_addr_base_for_vector_ref. 
        (vect_generate_tmps_on_preheader): fix comment.
        (vect_transform_loop): add calls to tree_ssa_loop_version and
        vect_create_cond_for_align_checks to implement the vector loop
        versioning for alignment.
        (vect_analyze_operations, vect_mark_stmts_to_be_vectorized,
        vect_analyze_data_refs): use num_blocks field from _loop_vec_info.

testsuite/Changelog;

         * gcc.dg/vect/vect-33.c: Remove xfail *-*-*, now vectorized.
         * gcc.dg/vect/vect-44.c: Remove xfail *-*-*, now vectorized.
         * gcc.dg/vect/vect-48.c: Remove xfail *-*-*, now vectorized.

 

Attachment: vect.Aug31.diff
Description: Binary data

Attachment: testpatch.Aug31
Description: Binary data


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