diff options
author | Alex Coplan <alex.coplan@arm.com> | 2024-06-24 13:54:48 +0100 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2025-01-10 21:21:07 +0000 |
commit | 086031c058598512d09bf898e4db3735b3e1f22c (patch) | |
tree | 291e7682dd464a1e6a29009a235e46e74e0021f3 /gcc | |
parent | f4e259b4a66c81c234608056117836e13606e4c8 (diff) | |
download | gcc-086031c058598512d09bf898e4db3735b3e1f22c.zip gcc-086031c058598512d09bf898e4db3735b3e1f22c.tar.gz gcc-086031c058598512d09bf898e4db3735b3e1f22c.tar.bz2 |
vect: Also cost gconds for scalar [PR118211]
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-loop.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index bb1138b..edd7d4d 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -1688,7 +1688,9 @@ vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo) 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. */ |