aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 33a1f58..129129f 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -354,22 +354,36 @@ shrink_simd_arrays
delete simd_array_to_simduid_htab;
}
-/* A helper function to free data refs. */
+/* Initialize the vec_info with kind KIND_IN and target cost data
+ TARGET_COST_DATA_IN. */
+
+vec_info::vec_info (vec_info::vec_kind kind_in, void *target_cost_data_in)
+ : kind (kind_in),
+ datarefs (vNULL),
+ ddrs (vNULL),
+ target_cost_data (target_cost_data_in)
+{
+}
-void
-vect_destroy_datarefs (vec_info *vinfo)
+vec_info::~vec_info ()
{
+ slp_instance instance;
struct data_reference *dr;
unsigned int i;
- FOR_EACH_VEC_ELT (vinfo->datarefs, i, dr)
+ FOR_EACH_VEC_ELT (datarefs, i, dr)
if (dr->aux)
{
free (dr->aux);
dr->aux = NULL;
}
- free_data_refs (vinfo->datarefs);
+ FOR_EACH_VEC_ELT (slp_instances, i, instance)
+ vect_free_slp_instance (instance);
+
+ free_data_refs (datarefs);
+ free_dependence_relations (ddrs);
+ destroy_cost_data (target_cost_data);
}
/* A helper function to free scev and LOOP niter information, as well as
@@ -830,7 +844,7 @@ vectorize_loops (void)
has_mask_store = false;
if (loop_vinfo)
has_mask_store = LOOP_VINFO_HAS_MASK_STORE (loop_vinfo);
- destroy_loop_vec_info (loop_vinfo, true);
+ delete loop_vinfo;
if (has_mask_store)
optimize_mask_stores (loop);
loop->aux = NULL;