aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2004-12-29 13:16:07 +0000
committerDorit Nuzman <dorit@gcc.gnu.org>2004-12-29 13:16:07 +0000
commit1de6a873129a16012941fb75d8c2a1bbde736690 (patch)
treecf9d1470da9d3ec01f212318944d0be7811a10b6 /gcc/tree-vectorizer.h
parent6e611d9276d1c7d278be5a47c09d3cab6b34fbf8 (diff)
downloadgcc-1de6a873129a16012941fb75d8c2a1bbde736690.zip
gcc-1de6a873129a16012941fb75d8c2a1bbde736690.tar.gz
gcc-1de6a873129a16012941fb75d8c2a1bbde736690.tar.bz2
re PR tree-optimization/18179 (vectorizer: wrong alignment/step/initial-address computed for struct accesses)
2004-12-29 Ira Rosen <irar@il.ibm.com> PR tree-optimization/18179 * tree-vectorizer.h (struct _stmt_vec_info): Add new fields: initial_offset, step, misalignment and base_aligned_p and macros to access them. * tree-vectorizer.c (vect_analyze_offset_expr): New function. (new_stmt_vec_info): Initialize the new fields of stmt_vec_info. (vect_create_data_ref_ptr): Fix printings. From-SVN: r92701
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h54
1 files changed, 37 insertions, 17 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 20563af..642e384 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -85,26 +85,46 @@ typedef struct _stmt_vec_info {
/* Aliasing information. */
tree memtag;
- /* Data reference base. This field holds the entire invariant part of the
- data-reference (with respect to the relevant loop), as opposed to the
- field DR_BASE of the STMT_VINFO_DATA_REF struct, which holds only the
- initial base; e.g:
- REF BR_BASE VECT_DR_BASE
- a[i] a a
- a[i][j] a a[i] */
- tree vect_dr_base;
+ /** The following fields are used to store the information about
+ data-reference. {base + initial_offset} is the first location accessed by
+ data-ref in the loop, and step is the stride of data-ref in the loop;
+ e.g.:
+
+ Example 1 Example 2
+ data-ref a[j].b[i][j] a + 4B (a is int*)
+
+ base a a
+ initial_offset j_0*D_j + i_0*D_i + C 4
+ step D_j 4
+
+ **/
+ /* The above base, offset and step. */
+ tree base;
+ tree initial_offset;
+ tree step;
+
+ /* Alignment information. Whether the base of the data-reference is aligned
+ to vectype. */
+ bool base_aligned_p;
+ /* Alignment information. The offset of the data-reference from its base
+ in bytes. */
+ tree misalignment;
} *stmt_vec_info;
/* Access Functions. */
-#define STMT_VINFO_TYPE(S) (S)->type
-#define STMT_VINFO_STMT(S) (S)->stmt
-#define STMT_VINFO_LOOP(S) (S)->loop
-#define STMT_VINFO_RELEVANT_P(S) (S)->relevant
-#define STMT_VINFO_VECTYPE(S) (S)->vectype
-#define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
-#define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
-#define STMT_VINFO_MEMTAG(S) (S)->memtag
-#define STMT_VINFO_VECT_DR_BASE(S) (S)->vect_dr_base
+#define STMT_VINFO_TYPE(S) (S)->type
+#define STMT_VINFO_STMT(S) (S)->stmt
+#define STMT_VINFO_LOOP(S) (S)->loop
+#define STMT_VINFO_RELEVANT_P(S) (S)->relevant
+#define STMT_VINFO_VECTYPE(S) (S)->vectype
+#define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
+#define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
+#define STMT_VINFO_MEMTAG(S) (S)->memtag
+#define STMT_VINFO_VECT_DR_BASE(S) (S)->base
+#define STMT_VINFO_VECT_INIT_OFFSET(S) (S)->initial_offset
+#define STMT_VINFO_VECT_STEP(S) (S)->step
+#define STMT_VINFO_VECT_BASE_ALIGNED_P(S) (S)->base_aligned_p
+#define STMT_VINFO_VECT_MISALIGNMENT(S) (S)->misalignment
static inline void set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info);
static inline stmt_vec_info vinfo_for_stmt (tree stmt);