From 39b8f742ef14abba097084b567e57563e555d0df Mon Sep 17 00:00:00 2001 From: dorit Date: Tue, 15 Mar 2005 18:33:09 +0000 Subject: * tree-vectorizer.h (unknown_alignment_for_access_p): Replaced by known_alignment_for_access_p. (known_alignment_for_access_p): New. (do_peeling_for_alignment): Field made int instead of bool and renamed to peeling_for_alignment. (LOOP_DO_PEELING_FOR_ALIGNMENT): Renamed to LOOP_PEELING_FOR_ALIGNMENT. * tree-vect-analyze.c (vect_determine_vectorization_factor): New. This functionality used to be in vect_analyze_operations. (vect_analyze_operations): Code to determine vectorization factor was moved to vect_determine_vectorization_factor. (vect_enhance_data_refs_alignment): Update to correct alignment when it is known instead of -1. Set LOOP_PEELING_FOR_ALIGNMENT to peeling factor. (vect_analyze_loop): Call vect_determine_vectorization_factor (used to be part of vect_analyze_operations). * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Use fold when creating the guard condition, as the number of iterations may be constant. (slpeel_tree_peel_loop_to_edge): Use new name of LOOP_DO_PEELING_FOR_ALIGNMENT. Set it to 0 instead of false. * tree-vect-transform.c (vect_gen_niters_for_prolog_loop): Handle known alignment case more efficiently. Use LOOP_PEELING_FOR_ALIGNMENT. (vect_do_peeling_for_alignment): Use fold. (vect_transform_loop): Use new name of LOOP_DO_PEELING_FOR_ALIGNMENT. (vect_update_inits_of_dr): Renamed to vect_update_init_of_dr. (vect_update_inits_of_drs): Use new name of vect_update_inits_of_dr. (vectorizable_store): Fix assertion to use == instead of =. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96526 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index b761f4d0ef3..e32eed2364a 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -95,9 +95,15 @@ typedef struct _loop_vec_info { /* Unknown DRs according to which loop was peeled. */ struct data_reference *unaligned_dr; - /* If true, loop is peeled. - unaligned_drs show in this case DRs used for peeling. */ - bool do_peeling_for_alignment; + /* peeling_for_alignment indicates whether peeling for alignment will take + place, and what the peeling factor should be: + peeling_for_alignment = X means: + If X=0: Peeling for alignment will not be applied. + If X>0: Peel first X iterations. + If X=-1: Generate a runtime test to calculate the number of iterations + to be peeled, using the dataref recorded in the field + unaligned_dr. */ + int peeling_for_alignment; /* All data references in the loop that are being written to. */ varray_type data_ref_writes; @@ -119,7 +125,7 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_DATAREF_WRITES(L) (L)->data_ref_writes #define LOOP_VINFO_DATAREF_READS(L) (L)->data_ref_reads #define LOOP_VINFO_INT_NITERS(L) (TREE_INT_CST_LOW ((L)->num_iters)) -#define LOOP_DO_PEELING_FOR_ALIGNMENT(L) (L)->do_peeling_for_alignment +#define LOOP_PEELING_FOR_ALIGNMENT(L) (L)->peeling_for_alignment #define LOOP_VINFO_UNALIGNED_DR(L) (L)->unaligned_dr #define LOOP_VINFO_LOC(L) (L)->loop_line_number @@ -242,7 +248,8 @@ vinfo_for_stmt (tree stmt) /* Info on data references alignment. */ /*-----------------------------------------------------------------*/ -/* The misalignment of the memory access in bytes. */ +/* Reflects actual alignment of first access in the vectorized loop, + taking into account peeling/versioning if applied. */ #define DR_MISALIGNMENT(DR) (DR)->aux static inline bool @@ -252,9 +259,9 @@ aligned_access_p (struct data_reference *data_ref_info) } static inline bool -unknown_alignment_for_access_p (struct data_reference *data_ref_info) +known_alignment_for_access_p (struct data_reference *data_ref_info) { - return (DR_MISALIGNMENT (data_ref_info) == -1); + return (DR_MISALIGNMENT (data_ref_info) != -1); } /* Perform signed modulo, always returning a non-negative value. */ -- cgit v1.2.3