diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-03 07:13:36 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-03 07:13:36 +0000 |
commit | 9dd88d41622f5fe96f5a25b7989418079b854116 (patch) | |
tree | 03864e5caa088bc8f553b9ca5791287f5d2b5a45 /gcc/tree-vectorizer.h | |
parent | d1a8d2ac02c05bd4b24981a586762fda6ae6ffff (diff) | |
download | gcc-9dd88d41622f5fe96f5a25b7989418079b854116.tar.gz |
2015-08-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/66917
* tree-vectorizer.h (struct dataref_aux): Add base_element_aligned
field.
(DR_VECT_AUX): New macro.
(set_dr_misalignment): Adjust.
(dr_misalignment): Likewise.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment):
Compute whether the base is at least element aligned.
* tree-vect-stmts.c (ensure_base_align): Adjust.
(vectorizable_store): If the base is not element aligned
preserve alignment of the original access if misalignment is unknown.
(vectorizable_load): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index dfa879583ac..170dd186d31 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -707,11 +707,16 @@ typedef struct _stmt_vec_info { #define STMT_SLP_TYPE(S) (S)->slp_type struct dataref_aux { - tree base_decl; - bool base_misaligned; int misalignment; + /* If true the alignment of base_decl needs to be increased. */ + bool base_misaligned; + /* If true we know the base is at least vector element alignment aligned. */ + bool base_element_aligned; + tree base_decl; }; +#define DR_VECT_AUX(dr) ((dataref_aux *)(dr)->aux) + #define VECT_MAX_COST 1000 /* The maximum number of intermediate steps required in multi-step type @@ -910,14 +915,13 @@ destroy_cost_data (void *data) targetm.vectorize.destroy_cost_data (data); } - /*-----------------------------------------------------------------*/ /* Info on data references alignment. */ /*-----------------------------------------------------------------*/ inline void set_dr_misalignment (struct data_reference *dr, int val) { - dataref_aux *data_aux = (dataref_aux *) dr->aux; + dataref_aux *data_aux = DR_VECT_AUX (dr); if (!data_aux) { @@ -931,8 +935,7 @@ set_dr_misalignment (struct data_reference *dr, int val) inline int dr_misalignment (struct data_reference *dr) { - gcc_assert (dr->aux); - return ((dataref_aux *) dr->aux)->misalignment; + return DR_VECT_AUX (dr)->misalignment; } /* Reflects actual alignment of first access in the vectorized loop, |