aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorVictor Kaplansky <victork@il.ibm.com>2008-03-12 06:06:00 +0000
committerVictor Kaplansky <victork@gcc.gnu.org>2008-03-12 06:06:00 +0000
commit628781031e0b4f75bb9a59a045b5ed2a4daf568b (patch)
tree3f8f1ec99cc8e6149bfb3ef986a0c63b812091e1 /gcc/tree-vectorizer.c
parentdedba682444ffb964500c483a6ab3f4267f652f5 (diff)
downloadgcc-628781031e0b4f75bb9a59a045b5ed2a4daf568b.zip
gcc-628781031e0b4f75bb9a59a045b5ed2a4daf568b.tar.gz
gcc-628781031e0b4f75bb9a59a045b5ed2a4daf568b.tar.bz2
tree-vectorizer.c (free_stmt_vec_info): New function.
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(). Co-Authored-By: Ira Rosen <irar@il.ibm.com> From-SVN: r133134
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 f657eea..7f631fb 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;