diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2022-09-02 14:00:15 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2022-09-02 14:00:15 +0100 |
commit | 67b6d1be0623de1a8aa32fe249bfa0129c55b11a (patch) | |
tree | 6bd0ccd739be294ddf2c026c067178f76e5c6c20 /gcc/fortran/trans-openmp.cc | |
parent | eab511df13ca6abb24c3c2abb0f420a89c91e310 (diff) | |
download | gcc-67b6d1be0623de1a8aa32fe249bfa0129c55b11a.zip gcc-67b6d1be0623de1a8aa32fe249bfa0129c55b11a.tar.gz gcc-67b6d1be0623de1a8aa32fe249bfa0129c55b11a.tar.bz2 |
vect: Use better fallback costs in layout subpass
vect_optimize_slp_pass always treats the starting layout as valid,
to avoid having to "optimise" when every possible choice is invalid.
But it gives the starting layout a high cost if it seems like the
target might reject it, in the hope that this will encourage other
(valid) layouts.
The testcase for PR106787 showed that this was flawed, since it was
triggering even in cases where the number of input lanes is different
from the number of output lanes. Picking such a high cost could also
make costs for loop-invariant nodes overwhelm the costs for inner-loop
nodes.
This patch makes the costing less aggressive by (a) restricting
it to N-to-N permutations and (b) assigning the maximum cost of
a permute.
gcc/
* tree-vect-slp.cc (vect_optimize_slp_pass::internal_node_cost):
Reduce the fallback cost to 1. Only use it if the number of
input lanes is equal to the number of output lanes.
gcc/testsuite/
* gcc.dg/vect/bb-slp-layout-20.c: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.cc')
0 files changed, 0 insertions, 0 deletions