diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-26 10:52:44 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-26 10:59:08 +0200 |
commit | ccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9 (patch) | |
tree | a9987059f424dda9a1c3031d373e75c0f8163417 /gcc/tree-vect-data-refs.c | |
parent | a31a3d0421f0cf1f7eefacfec8cbf37e7f91600d (diff) | |
download | gcc-ccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9.zip gcc-ccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9.tar.gz gcc-ccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9.tar.bz2 |
Turn vect_create_addr_base_for_vector_ref offset into a byte offset
This changes the offset in elements for vect_create_addr_base_for_vector_ref
and vect_create_data_ref_ptr to an offset in bytes, easing a following
refactoring.
2021-10-26 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
Take offset in bytes.
(vect_create_data_ref_ptr): Likewise.
* tree-vect-loop-manip.c (get_misalign_in_elems): Multiply
offset by element size.
(vect_create_cond_for_align_checks): Likewise.
* tree-vect-stmts.c (get_negative_load_store_type): Likewise.
(vectorizable_load): Remove duplicate leftover from merge
conflict.
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index cbcd4b8..46360c5 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4753,8 +4753,7 @@ vect_duplicate_ssa_name_ptr_info (tree name, dr_vec_info *dr_info) if LOOP=i_loop: &in (relative to i_loop) if LOOP=j_loop: &in+i*2B (relative to j_loop) BYTE_OFFSET: Optional, defaulted to NULL. If supplied, it is added to the - initial address. Unlike OFFSET, which is number of elements to - be added, BYTE_OFFSET is measured in bytes. + initial address. Both OFFSET and BYTE_OFFSET are measured in bytes. Output: 1. Return an SSA_NAME whose value is the address of the memory location of @@ -4777,7 +4776,6 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo, stmt_vec_info stmt_info, tree dest; gimple_seq seq = NULL; tree vect_ptr_type; - tree step = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr))); loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo); innermost_loop_behavior *drb = vect_dr_behavior (vinfo, dr_info); @@ -4801,8 +4799,7 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo, stmt_vec_info stmt_info, if (offset) { - offset = fold_build2 (MULT_EXPR, sizetype, - fold_convert (sizetype, offset), step); + offset = fold_convert (sizetype, offset); base_offset = fold_build2 (PLUS_EXPR, sizetype, base_offset, offset); } @@ -4860,8 +4857,8 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo, stmt_vec_info stmt_info, 2. AGGR_TYPE: the type of the reference, which should be either a vector or an array. 3. AT_LOOP: the loop where the vector memref is to be created. - 4. OFFSET (optional): an offset to be added to the initial address accessed - by the data-ref in STMT_INFO. + 4. OFFSET (optional): a byte offset to be added to the initial address + accessed by the data-ref in STMT_INFO. 5. BSI: location where the new stmts are to be placed if there is no loop 6. ONLY_INIT: indicate if ap is to be updated in the loop, or remain pointing to the initial address. @@ -4885,7 +4882,7 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo, stmt_vec_info stmt_info, if OFFSET is not supplied: initial_address = &a[init]; if OFFSET is supplied: - initial_address = &a[init + OFFSET]; + initial_address = &a[init] + OFFSET; if BYTE_OFFSET is supplied: initial_address = &a[init] + BYTE_OFFSET; @@ -5031,7 +5028,7 @@ vect_create_data_ref_ptr (vec_info *vinfo, stmt_vec_info stmt_info, /* (2) Calculate the initial address of the aggregate-pointer, and set the aggregate-pointer to point to it before the loop. */ - /* Create: (&(base[init_val+offset]+byte_offset) in the loop preheader. */ + /* Create: (&(base[init_val]+offset+byte_offset) in the loop preheader. */ new_temp = vect_create_addr_base_for_vector_ref (vinfo, stmt_info, &new_stmt_list, |