On Thu, May 4, 2017 at 11:05 AM, Robin Dapp <rd...@linux.vnet.ibm.com> wrote: > Wrap some frequently used snippets in separate functions.
+/* Get the costs of peeling NPEEL iterations checking data access costs + for all data refs. */ -/* Traverse peeling hash table and calculate cost for each peeling option. - Find the one with the lowest cost. */ - -int -vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot, - _vect_peel_extended_info *min) +static void +vect_get_peeling_costs_all_drs (struct data_reference *dr0, + unsigned int *inside_cost, + unsigned int *outside_cost, + stmt_vector_for_cost *body_cost_vec, + unsigned int npeel, unsigned int vf) { - vect_peel_info elem = *slot; - int save_misalignment, dummy; - unsigned int inside_cost = 0, outside_cost = 0, i; - gimple *stmt = DR_STMT (elem->dr); + gimple *stmt = DR_STMT (dr0); stmt_vec_info stmt_info = vinfo_for_stmt (stmt); ick. Another case that shows why I like context diffs more ... Patch looks ok. Thanks, Richard. > gcc/ChangeLog: > > 2017-04-26 Robin Dapp <rd...@linux.vnet.ibm.com> > > * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename. > (vect_get_peeling_costs_all_drs): Create function. > (vect_peeling_hash_get_lowest_cost): > Use vect_get_peeling_costs_all_drs. > (vect_peeling_supportable): Create function.