aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2021-12-02 14:34:15 +0000
committerAndre Vieira <andre.simoesdiasvieira@arm.com>2022-01-10 17:54:33 +0000
commitd3ff7420e941931d32ce2e332e7968fe67ba20af (patch)
tree14dc5d0f7401326cf19569ccfa92dc0841a4ac0c /gcc/tree-vectorizer.c
parent828474fafd2ed33430172fe227f9da7d6fb98723 (diff)
downloadgcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.zip
gcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.tar.gz
gcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.tar.bz2
[vect] Re-analyze all modes for epilogues
gcc/ChangeLog: * tree-vectorizer.c (better_epilogue_loop_than_p): Round factors up for epilogue costing. * tree-vect-loop.c (vect_analyze_loop): Re-analyze all modes for epilogues, unless we are guaranteed that we can't have partial vectors. * genopinit.c: (partial_vectors_supported): Generate new function. gcc/testsuite/ChangeLog: * gcc.target/aarch64/masked_epilogue.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index e82750c..48eed40 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1887,11 +1887,13 @@ vector_costs::better_epilogue_loop_than_p (const vector_costs *other,
{
unsigned HOST_WIDE_INT main_vf_max
= estimated_poly_value (main_poly_vf, POLY_VALUE_MAX);
+ unsigned HOST_WIDE_INT other_vf_max
+ = estimated_poly_value (other_vf, POLY_VALUE_MAX);
+ unsigned HOST_WIDE_INT this_vf_max
+ = estimated_poly_value (this_vf, POLY_VALUE_MAX);
- other_factor = main_vf_max / estimated_poly_value (other_vf,
- POLY_VALUE_MAX);
- this_factor = main_vf_max / estimated_poly_value (this_vf,
- POLY_VALUE_MAX);
+ other_factor = CEIL (main_vf_max, other_vf_max);
+ this_factor = CEIL (main_vf_max, this_vf_max);
/* If the loop is not using partial vectors then it will iterate one
time less than one that does. It is safe to subtract one here,