summaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorvictork <victork@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-12 06:06:00 +0000
committervictork <victork@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-12 06:06:00 +0000
commitc6ba58f9401741fdfa802f15783cfc375f69820a (patch)
tree3f8f1ec99cc8e6149bfb3ef986a0c63b812091e1 /gcc/tree-vectorizer.c
parent2c724f912dc7f09ec21848aa8b48871ae2b12b29 (diff)
downloadgcc-c6ba58f9401741fdfa802f15783cfc375f69820a.tar.gz
2008-03-12 Victor Kaplansky <victork@il.ibm.com>
Ira Rosen <irar@il.ibm.com> * tree-vectorizer.c (free_stmt_vec_info): New function. (destroy_loop_vec_info): Move code to free_stmt_vec_info(). Call free_stmt_vec_info(). Free LOOP_VINFO_STRIDED_STORES.. * tree-vectorizer.h (free_stmt_vec_info): Declare. * tree-vect-transform.c (vectorizable_conversion): Free vec_oprnds0 if it was allocated. (vect_permute_store_chain): Remove unused VECs. (vectorizable_store): Free VECs that are allocated in the.. function. (vect_transform_strided_load, vectorizable_load): Likewise. (vect_remove_stores): Simplify the code. (vect_transform_loop): Move code to vect_remove_stores(). Call vect_remove_stores() and free_stmt_vec_info(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133134 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index f657eeaa198..7f631fb6f61 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1545,6 +1545,22 @@ new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
}
+/* Free stmt vectorization related info. */
+
+void
+free_stmt_vec_info (tree stmt)
+{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
+ if (!stmt_info)
+ return;
+
+ VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
+ free (stmt_info);
+ set_stmt_info (stmt_ann (stmt), NULL);
+}
+
+
/* Function bb_in_loop_p
Used as predicate for dfs order traversal of the loop bbs. */
@@ -1701,21 +1717,13 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
{
basic_block bb = bbs[j];
tree phi;
- stmt_vec_info stmt_info;
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- stmt_ann_t ann = stmt_ann (phi);
-
- stmt_info = vinfo_for_stmt (phi);
- free (stmt_info);
- set_stmt_info (ann, NULL);
- }
+ free_stmt_vec_info (phi);
for (si = bsi_start (bb); !bsi_end_p (si); )
{
tree stmt = bsi_stmt (si);
- stmt_ann_t ann = stmt_ann (stmt);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
if (stmt_info)
@@ -1733,9 +1741,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
}
/* Free stmt_vec_info. */
- VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
- free (stmt_info);
- set_stmt_info (ann, NULL);
+ free_stmt_vec_info (stmt);
/* Remove dead "pattern stmts". */
if (remove_stmt_p)
@@ -1754,6 +1760,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
for (j = 0; VEC_iterate (slp_instance, slp_instances, j, instance); j++)
vect_free_slp_tree (SLP_INSTANCE_TREE (instance));
VEC_free (slp_instance, heap, LOOP_VINFO_SLP_INSTANCES (loop_vinfo));
+ VEC_free (tree, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo));
free (loop_vinfo);
loop->aux = NULL;