+2017-12-14 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * gimple-ssa-strength-reduction.c (analyze_increments):
+ Distinguish replacement costs for constant strides from those for
+ unknown strides.
+
2017-12-14 Jakub Jelinek <jakub@redhat.com>
* var-tracking.c (variable_tracking_main_1): Formatting fix.
else if (first_dep->kind == CAND_MULT)
{
int cost = mult_by_coeff_cost (incr, mode, speed);
- int repl_savings = mul_cost (speed, mode) - add_cost (speed, mode);
+ int repl_savings;
+
+ if (tree_fits_shwi_p (first_dep->stride))
+ {
+ HOST_WIDE_INT hwi_stride = tree_to_shwi (first_dep->stride);
+ repl_savings = mult_by_coeff_cost (hwi_stride, mode, speed);
+ }
+ else
+ repl_savings = mul_cost (speed, mode);
+ repl_savings -= add_cost (speed, mode);
+
if (speed)
cost = lowest_cost_path (cost, repl_savings, first_dep,
incr_vec[i].incr, COUNT_PHIS);