Currently we only cost gconds for the vector loop while we omit costing
them when analyzing the scalar loop; this unfairly penalizes the vector
loop in the case of loops with early exits.
This (together with the previous patches) enables us to vectorize
std::find with 64-bit element sizes.
gcc/ChangeLog:
PR tree-optimization/118211
PR tree-optimization/116126
* tree-vect-loop.cc (vect_compute_single_scalar_iteration_cost):
Don't skip over gconds.
gimple *stmt = gsi_stmt (si);
stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (stmt);
- if (!is_gimple_assign (stmt) && !is_gimple_call (stmt))
+ if (!is_gimple_assign (stmt)
+ && !is_gimple_call (stmt)
+ && !is_a<gcond *> (stmt))
continue;
/* Skip stmts that are not vectorized inside the loop. */