aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-05-29 11:49:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-05-29 11:49:44 +0000
commitf8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8 (patch)
treefd063fc6faee62c11cf26bbb7454f96ed1214453 /gcc/tree-vectorizer.h
parent092cb01cbf25e1c19d0b86bfac6dc4404c14a7dd (diff)
downloadgcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.zip
gcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.tar.gz
gcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.tar.bz2
tree-vectorizer.h (struct vec_info): Add stmt_vec_infos member.
2018-05-29 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (struct vec_info): Add stmt_vec_infos member. (stmt_vec_info_vec): Make pointer. (init_stmt_vec_info_vec): Remove. (free_stmt_vec_info_vec): Likewise. (set_stmt_vec_info_vec): New function. (free_stmt_vec_infos): Likewise. (vinfo_for_stmt): Adjust for stmt_vec_info_vec indirection. (set_vinfo_for_stmt): Likewise. (get_earlier_stmt): Likewise. (get_later_stmt): Likewise. * tree-vectorizer.c (stmt_vec_info_vec): Make pointer. (vec_info::vec_info): Allocate stmt_vec_infos and set the global. (vec_info::~vec_info): Free stmt_vec_infos. (vectorize_loops): Set the global stmt_vec_info_vec to NULL. Remove old init_stmt_vec_info_vec/free_stmt_vec_info_vec calls. (pass_slp_vectorize::execute): Likewise. * tree-vect-stmts.c (init_stmt_vec_info_vec): Remove. (free_stmt_vec_info_vec): Likewise. (set_stmt_vec_info_vec): New function. (free_stmt_vec_infos): Likewise. * tree-vect-loop.c (_loop_vec_info::~_loop_vec_info): Set the global stmt_vec_info_vec. * tree-parloops.c (gather_scalar_reductions): Use set_stmt_vec_info_vec/free_stmt_vec_infos and maintain a local vector. From-SVN: r260892
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index ef8b695..f764634 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -197,6 +197,9 @@ struct vec_info {
/* The type of vectorization. */
vec_kind kind;
+ /* The mapping of GIMPLE UID to stmt_vec_info. */
+ vec<struct _stmt_vec_info *> stmt_vec_infos;
+
/* All SLP instances. */
auto_vec<slp_instance> slp_instances;
@@ -1009,10 +1012,10 @@ struct dataref_aux {
&& TYPE_PRECISION (TYPE) == 1 \
&& TYPE_UNSIGNED (TYPE)))
-extern vec<stmt_vec_info> stmt_vec_info_vec;
+extern vec<stmt_vec_info> *stmt_vec_info_vec;
-void init_stmt_vec_info_vec (void);
-void free_stmt_vec_info_vec (void);
+void set_stmt_vec_info_vec (vec<stmt_vec_info> *);
+void free_stmt_vec_infos (vec<stmt_vec_info> *);
/* Return a stmt_vec_info corresponding to STMT. */
@@ -1023,7 +1026,7 @@ vinfo_for_stmt (gimple *stmt)
if (uid <= 0)
return NULL;
- return stmt_vec_info_vec[uid - 1];
+ return (*stmt_vec_info_vec)[uid - 1];
}
/* Set vectorizer information INFO for STMT. */
@@ -1035,14 +1038,14 @@ set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info)
if (uid == 0)
{
gcc_checking_assert (info);
- uid = stmt_vec_info_vec.length () + 1;
+ uid = stmt_vec_info_vec->length () + 1;
gimple_set_uid (stmt, uid);
- stmt_vec_info_vec.safe_push (info);
+ stmt_vec_info_vec->safe_push (info);
}
else
{
gcc_checking_assert (info == NULL);
- stmt_vec_info_vec[uid - 1] = info;
+ (*stmt_vec_info_vec)[uid - 1] = info;
}
}
@@ -1065,8 +1068,8 @@ get_earlier_stmt (gimple *stmt1, gimple *stmt2)
if (uid1 == 0 || uid2 == 0)
return NULL;
- gcc_checking_assert (uid1 <= stmt_vec_info_vec.length ()
- && uid2 <= stmt_vec_info_vec.length ());
+ gcc_checking_assert (uid1 <= stmt_vec_info_vec->length ()
+ && uid2 <= stmt_vec_info_vec->length ());
if (uid1 < uid2)
return stmt1;
@@ -1093,8 +1096,8 @@ get_later_stmt (gimple *stmt1, gimple *stmt2)
if (uid1 == 0 || uid2 == 0)
return NULL;
- gcc_assert (uid1 <= stmt_vec_info_vec.length ());
- gcc_assert (uid2 <= stmt_vec_info_vec.length ());
+ gcc_assert (uid1 <= stmt_vec_info_vec->length ());
+ gcc_assert (uid2 <= stmt_vec_info_vec->length ());
if (uid1 > uid2)
return stmt1;