aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-22 16:26:43 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-22 16:26:43 +0000
commit20bdc473ebd7176544e0c8cdf87750adc6f44a97 (patch)
tree3f0a8db11d05c48f085d0206443df458f655ad52 /gcc/tree-vectorizer.h
parentdce04e57faaa33c1da286effc97943f5c9924691 (diff)
downloadgcc-20bdc473ebd7176544e0c8cdf87750adc6f44a97.zip
gcc-20bdc473ebd7176544e0c8cdf87750adc6f44a97.tar.gz
gcc-20bdc473ebd7176544e0c8cdf87750adc6f44a97.tar.bz2
Add a vect_get_scalar_dr_size helper function
This patch adds a helper function for getting the number of bytes accessed by an unvectorised data reference, which helps when general modes have a variable size. 2017-09-22 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-vectorizer.h (vect_get_scalar_dr_size): New function. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Use it. (vect_enhance_data_refs_alignment): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r253099
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index d6753ff..5d273ca 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1095,6 +1095,19 @@ vect_get_num_copies (loop_vec_info loop_vinfo, tree vectype)
/ TYPE_VECTOR_SUBPARTS (vectype));
}
+/* Return the size of the value accessed by unvectorized data reference DR.
+ This is only valid once STMT_VINFO_VECTYPE has been calculated for the
+ associated gimple statement, since that guarantees that DR accesses
+ either a scalar or a scalar equivalent. ("Scalar equivalent" here
+ includes things like V1SI, which can be vectorized in the same way
+ as a plain SI.) */
+
+inline unsigned int
+vect_get_scalar_dr_size (struct data_reference *dr)
+{
+ return tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr))));
+}
+
/* Source location */
extern source_location vect_location;