diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-03 12:54:45 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-03 12:54:45 +0000 |
commit | 30f263a419dd1cf9804dea818dab0c2c40fda265 (patch) | |
tree | c155e715aab82e74ee4d9c068a74667321236329 /gcc/tree-vect-analyze.c | |
parent | 6b75e1228cecab24ff5650ca0e98b8f7aae8d5ad (diff) | |
download | gcc-30f263a419dd1cf9804dea818dab0c2c40fda265.tar.gz |
PR tree-optimization/31699
* tree-vect-analyze.c (vect_update_misalignment_for_peel): Remove wrong
code.
(vect_enhance_data_refs_alignment): Compute peel amount using
TYPE_VECTOR_SUBPARTS instead of vf.
* tree-vect-transform.c (vect_gen_niters_for_prolog_loop): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r-- | gcc/tree-vect-analyze.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index c195c7ab323..3a4841d2c05 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -1258,15 +1258,6 @@ vect_update_misalignment_for_peel (struct data_reference *dr, if (DR_GROUP_FIRST_DR (peel_stmt_info)) dr_peel_size *= DR_GROUP_SIZE (peel_stmt_info); - if (known_alignment_for_access_p (dr) - && known_alignment_for_access_p (dr_peel) - && (DR_MISALIGNMENT (dr) / dr_size == - DR_MISALIGNMENT (dr_peel) / dr_peel_size)) - { - DR_MISALIGNMENT (dr) = 0; - return; - } - /* It can be assumed that the data refs with the same alignment as dr_peel are aligned in the vector loop. */ same_align_drs @@ -1507,7 +1498,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) the prolog loop ({VF - misalignment}), is a multiple of the number of the interleaved accesses. */ int elem_size, mis_in_elements; - int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo); + tree vectype = STMT_VINFO_VECTYPE (stmt_info); + int nelements = TYPE_VECTOR_SUBPARTS (vectype); /* FORNOW: handle only known alignment. */ if (!known_alignment_for_access_p (dr)) @@ -1516,10 +1508,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) break; } - elem_size = UNITS_PER_SIMD_WORD / vf; + elem_size = UNITS_PER_SIMD_WORD / nelements; mis_in_elements = DR_MISALIGNMENT (dr) / elem_size; - if ((vf - mis_in_elements) % DR_GROUP_SIZE (stmt_info)) + if ((nelements - mis_in_elements) % DR_GROUP_SIZE (stmt_info)) { do_peeling = false; break; @@ -1541,6 +1533,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) { int mis; int npeel = 0; + tree stmt = DR_STMT (dr0); + stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + tree vectype = STMT_VINFO_VECTYPE (stmt_info); + int nelements = TYPE_VECTOR_SUBPARTS (vectype); if (known_alignment_for_access_p (dr0)) { @@ -1550,7 +1546,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) factor minus the misalignment as an element count. */ mis = DR_MISALIGNMENT (dr0); mis /= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr0)))); - npeel = LOOP_VINFO_VECT_FACTOR (loop_vinfo) - mis; + npeel = nelements - mis; /* For interleaved data access every iteration accesses all the members of the group, therefore we divide the number of iterations |