aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-10-26 10:52:44 +0200
committerRichard Biener <rguenther@suse.de>2021-10-26 10:59:08 +0200
commitccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9 (patch)
treea9987059f424dda9a1c3031d373e75c0f8163417 /gcc/tree-vect-loop-manip.c
parenta31a3d0421f0cf1f7eefacfec8cbf37e7f91600d (diff)
downloadgcc-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-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 378b102..72d5831 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1625,7 +1625,9 @@ get_misalign_in_elems (gimple **seq, loop_vec_info loop_vinfo)
bool negative = tree_int_cst_compare (DR_STEP (dr_info->dr),
size_zero_node) < 0;
tree offset = (negative
- ? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1)
+ ? size_int ((-TYPE_VECTOR_SUBPARTS (vectype) + 1)
+ * TREE_INT_CST_LOW
+ (TYPE_SIZE_UNIT (TREE_TYPE (vectype))))
: size_zero_node);
tree start_addr = vect_create_addr_base_for_vector_ref (loop_vinfo,
stmt_info, seq,
@@ -3227,7 +3229,9 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
bool negative = tree_int_cst_compare
(DR_STEP (STMT_VINFO_DATA_REF (stmt_info)), size_zero_node) < 0;
tree offset = negative
- ? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1) : size_zero_node;
+ ? size_int ((-TYPE_VECTOR_SUBPARTS (vectype) + 1)
+ * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (vectype))))
+ : size_zero_node;
/* create: addr_tmp = (int)(address_of_first_vector) */
addr_base =