num_iters (NULL_TREE),
num_iters_unchanged (NULL_TREE),
num_iters_assumptions (NULL_TREE),
+ vector_costs (nullptr),
th (0),
versioning_threshold (0),
vectorization_factor (0),
delete ivexpr_map;
delete scan_map;
epilogue_vinfos.release ();
+ delete vector_costs;
/* When we release an epiloge vinfo that we do not intend to use
avoid clearing AUX of the main loop which should continue to
}
} /* bbs */
- add_stmt_costs (loop_vinfo->target_cost_data, &cost_vec);
+ add_stmt_costs (loop_vinfo->vector_costs, &cost_vec);
/* All operations in the loop are either irrelevant (deal with loop
control, or dead), or only used outside the loop and can be moved
LOOP_VINFO_INT_NITERS (loop_vinfo));
}
- LOOP_VINFO_TARGET_COST_DATA (loop_vinfo) = init_cost (loop_vinfo, false);
+ loop_vinfo->vector_costs = init_cost (loop_vinfo, false);
/* Analyze the alignment of the data-refs in the loop.
Fail if a data reference is found that cannot be vectorized. */
LOOP_VINFO_COMP_ALIAS_DDRS (loop_vinfo).release ();
LOOP_VINFO_CHECK_UNEQUAL_ADDRS (loop_vinfo).release ();
/* Reset target cost data. */
- delete LOOP_VINFO_TARGET_COST_DATA (loop_vinfo);
- LOOP_VINFO_TARGET_COST_DATA (loop_vinfo) = nullptr;
+ delete loop_vinfo->vector_costs;
+ loop_vinfo->vector_costs = nullptr;
/* Reset accumulated rgroup information. */
release_vec_loop_controls (&LOOP_VINFO_MASKS (loop_vinfo));
release_vec_loop_controls (&LOOP_VINFO_LENS (loop_vinfo));
int scalar_outside_cost = 0;
int assumed_vf = vect_vf_for_cost (loop_vinfo);
int npeel = LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo);
- vector_costs *target_cost_data = LOOP_VINFO_TARGET_COST_DATA (loop_vinfo);
+ vector_costs *target_cost_data = loop_vinfo->vector_costs;
/* Cost model disabled. */
if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
}
/* Complete the target-specific cost calculations. */
- finish_cost (LOOP_VINFO_TARGET_COST_DATA (loop_vinfo), &vec_prologue_cost,
+ finish_cost (loop_vinfo->vector_costs, &vec_prologue_cost,
&vec_inside_cost, &vec_epilogue_cost);
vec_outside_cost = (int)(vec_prologue_cost + vec_epilogue_cost);
else
{
i++;
-
- /* For BB vectorization remember the SLP graph entry
- cost for later. */
- if (is_a <bb_vec_info> (vinfo))
- instance->cost_vec = cost_vec;
- else
+ if (loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo))
{
- add_stmt_costs (vinfo->target_cost_data, &cost_vec);
+ add_stmt_costs (loop_vinfo->vector_costs, &cost_vec);
cost_vec.release ();
}
+ else
+ /* For BB vectorization remember the SLP graph entry
+ cost for later. */
+ instance->cost_vec = cost_vec;
}
}
stmt in the chain. */
auto_vec<stmt_vec_info> grouped_stores;
- /* Cost data used by the target cost model. */
- class vector_costs *target_cost_data;
-
/* The set of vector modes used in the vectorized region. */
mode_set used_vector_modes;
/* Condition under which this loop is analyzed and versioned. */
tree num_iters_assumptions;
+ /* The cost of the vector code. */
+ class vector_costs *vector_costs;
+
/* Threshold of number of iterations below which vectorization will not be
performed. It is calculated from MIN_PROFITABLE_ITERS and
param_min_vect_loop_bound. */
#define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor
#define LOOP_VINFO_REDUCTIONS(L) (L)->reductions
#define LOOP_VINFO_REDUCTION_CHAINS(L) (L)->reduction_chains
-#define LOOP_VINFO_TARGET_COST_DATA(L) (L)->target_cost_data
#define LOOP_VINFO_PEELING_FOR_GAPS(L) (L)->peeling_for_gaps
#define LOOP_VINFO_PEELING_FOR_NITER(L) (L)->peeling_for_niter
#define LOOP_VINFO_NO_DATA_DEPENDENCIES(L) (L)->no_data_dependencies