aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-02-09 10:11:35 +0100
committerRichard Biener <rguenther@suse.de>2021-02-09 10:11:35 +0100
commit283653f45595f53db486cbc2f1f10091cb45ea3b (patch)
treeefe55e0054e2b64740d67c450d9b61c47f07f701 /gcc
parent57d705da0b98f5d398c4b8f9bd76fe8ad98e13bc (diff)
downloadgcc-283653f45595f53db486cbc2f1f10091cb45ea3b.zip
gcc-283653f45595f53db486cbc2f1f10091cb45ea3b.tar.gz
gcc-283653f45595f53db486cbc2f1f10091cb45ea3b.tar.bz2
tree-optimization/99017 - be more forgiving in BB vect costing
This works around a SLP graph partitioning or cost collecting issue by being more forgiving in vect_bb_vectorization_profitable_p. 2021-02-09 Richard Biener <rguenther@suse.de> PR tree-optimization/99017 * tree-vect-slp.c (vect_bb_vectorization_profitable_p): Allow zero vector cost entries.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-slp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index b9f12c3..ea8a97b 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -4427,7 +4427,8 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
/* Now cost the portions individually. */
unsigned vi = 0;
unsigned si = 0;
- do
+ while (si < li_scalar_costs.length ()
+ && vi < li_vector_costs.length ())
{
unsigned sl = li_scalar_costs[si].first;
unsigned vl = li_vector_costs[vi].first;
@@ -4497,8 +4498,6 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
return false;
}
}
- while (si < li_scalar_costs.length ()
- && vi < li_vector_costs.length ());
if (vi < li_vector_costs.length ())
{
if (dump_enabled_p ())