]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Tweak comparisons with existing epilogue loops
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 4 Aug 2021 15:52:09 +0000 (16:52 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 4 Aug 2021 15:52:09 +0000 (16:52 +0100)
commit5a1017dc305c49c59129d45536630d02dbc01c45
treebafd9d80404fa85093744e1e3eef10137a575d47
parent315a1c3756cbc751c4af0ce0da2157a88d7c3b09
vect: Tweak comparisons with existing epilogue loops

This patch uses a more accurate scalar iteration estimate when
comparing the epilogue of a constant-iteration loop with a candidate
replacement epilogue.

In the testcase, the patch prevents a 1-to-3-element SVE epilogue
from seeming better than a 64-bit Advanced SIMD epilogue.

gcc/
* tree-vect-loop.c (vect_better_loop_vinfo_p): Detect cases in
which old_loop_vinfo is an epilogue loop that handles a constant
number of iterations.

gcc/testsuite/
* gcc.target/aarch64/sve/cost_model_12.c: New test.
gcc/testsuite/gcc.target/aarch64/sve/cost_model_12.c [new file with mode: 0644]
gcc/tree-vect-loop.c