diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index e97e71b6e3d..6d18d82079c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -14541,6 +14541,12 @@ aarch64_detect_vector_stmt_subtype (vec_info *vinfo, vect_cost_for_stmt kind, if (aarch64_sve_mode_p (TYPE_MODE (vectype))) sve_costs = aarch64_tune_params.vec_costs->sve; + /* It's generally better to avoid costing inductions, since the induction + will usually be hidden by other operations. This is particularly true + for things like COND_REDUCTIONS. */ + if (is_a (stmt_info->stmt)) + return 0; + /* Detect cases in which vec_to_scalar is describing the extraction of a vector element in preparation for a scalar store. The store itself is costed separately. */