diff options
author | victork <victork@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-12 06:06:00 +0000 |
---|---|---|
committer | victork <victork@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-12 06:06:00 +0000 |
commit | c6ba58f9401741fdfa802f15783cfc375f69820a (patch) | |
tree | 3f8f1ec99cc8e6149bfb3ef986a0c63b812091e1 /gcc/tree-vect-transform.c | |
parent | 2c724f912dc7f09ec21848aa8b48871ae2b12b29 (diff) | |
download | gcc-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-vect-transform.c')
-rw-r--r-- | gcc/tree-vect-transform.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index a35e963b48f..59fa6d5de80 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -3631,6 +3631,9 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi, *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info); } + if (vec_oprnds0) + VEC_free (tree, heap, vec_oprnds0); + return true; } @@ -4582,11 +4585,8 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain, tree scalar_dest, tmp; int i; unsigned int j; - VEC(tree,heap) *first, *second; scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0); - first = VEC_alloc (tree, heap, length/2); - second = VEC_alloc (tree, heap, length/2); /* Check that the operation is supported. */ if (!vect_strided_store_supported (vectype)) @@ -4969,6 +4969,11 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt, } } + VEC_free (tree, heap, dr_chain); + VEC_free (tree, heap, oprnds); + if (result_chain) + VEC_free (tree, heap, result_chain); + return true; } @@ -5474,6 +5479,8 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size, break; } } + + VEC_free (tree, heap, result_chain); return true; } @@ -5911,6 +5918,7 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt, if (!vect_transform_strided_load (stmt, dr_chain, group_size, bsi)) return false; *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info); + VEC_free (tree, heap, dr_chain); dr_chain = VEC_alloc (tree, heap, group_size); } else @@ -5923,6 +5931,9 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt, } } + if (dr_chain) + VEC_free (tree, heap, dr_chain); + return true; } @@ -7259,10 +7270,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo) static void vect_remove_stores (tree first_stmt) { - stmt_ann_t ann; tree next = first_stmt; tree tmp; - stmt_vec_info next_stmt_info; block_stmt_iterator next_si; while (next) @@ -7270,11 +7279,8 @@ vect_remove_stores (tree first_stmt) /* Free the attached stmt_vec_info and remove the stmt. */ next_si = bsi_for_stmt (next); bsi_remove (&next_si, true); - next_stmt_info = vinfo_for_stmt (next); - ann = stmt_ann (next); - tmp = DR_GROUP_NEXT_DR (next_stmt_info); - free (next_stmt_info); - set_stmt_info (ann, NULL); + tmp = DR_GROUP_NEXT_DR (vinfo_for_stmt (next)); + free_stmt_vec_info (next); next = tmp; } } @@ -7373,7 +7379,7 @@ vect_transform_loop (loop_vec_info loop_vinfo) struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo); int nbbs = loop->num_nodes; - block_stmt_iterator si, next_si; + block_stmt_iterator si; int i; tree ratio = NULL; int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo); @@ -7538,37 +7544,19 @@ vect_transform_loop (loop_vec_info loop_vinfo) is_store = vect_transform_stmt (stmt, &si, &strided_store, NULL); if (is_store) { - stmt_ann_t ann; if (STMT_VINFO_STRIDED_ACCESS (stmt_info)) { /* Interleaving. If IS_STORE is TRUE, the vectorization of the interleaving chain was completed - free all the stores in the chain. */ - tree next = DR_GROUP_FIRST_DR (stmt_info); - tree tmp; - stmt_vec_info next_stmt_info; - - while (next) - { - next_si = bsi_for_stmt (next); - next_stmt_info = vinfo_for_stmt (next); - /* Free the attached stmt_vec_info and remove the stmt. */ - ann = stmt_ann (next); - tmp = DR_GROUP_NEXT_DR (next_stmt_info); - free (next_stmt_info); - set_stmt_info (ann, NULL); - bsi_remove (&next_si, true); - next = tmp; - } + vect_remove_stores (DR_GROUP_FIRST_DR (stmt_info)); bsi_remove (&si, true); continue; } else { /* Free the attached stmt_vec_info and remove the stmt. */ - ann = stmt_ann (stmt); - free (stmt_info); - set_stmt_info (ann, NULL); + free_stmt_vec_info (stmt); bsi_remove (&si, true); continue; } |