aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.cc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2022-09-01 19:22:13 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2022-09-01 19:22:13 +0100
commitd2694766dcfff0278fa93d581340a10b150c0f44 (patch)
tree7f35881aaa65986887c387161b393bab673de954 /gcc/function.cc
parent5205f5b54ad769969ffd89978ba1bcee41380bf8 (diff)
downloadgcc-d2694766dcfff0278fa93d581340a10b150c0f44.zip
gcc-d2694766dcfff0278fa93d581340a10b150c0f44.tar.gz
gcc-d2694766dcfff0278fa93d581340a10b150c0f44.tar.bz2
vect: Try to remove single-vector permutes from SLP graph
This patch extends the SLP layout optimisation pass so that it tries to remove layout changes that are brought about by permutes of existing vectors. This fixes the bb-slp-pr54400.c regression on x86_64 and also means that we can remove the permutes in cases like: typedef float v4sf __attribute__((vector_size(sizeof(float)*4))); float __attribute__((noipa)) f(v4sf v0, v4sf v1) { return v0[0]*v1[0]+v0[1]*v1[1]+v0[2]*v1[2]+v0[3]*v1[3]; } The new test is a simple adaption of bb-slp-pr54400.c, with the same style of markup. gcc/ * tree-vect-slp.cc (vect_build_slp_tree_2): When building a VEC_PERM_EXPR of an existing vector, set the SLP_TREE_LANES to the number of vector elements, if that's a known constant. (vect_optimize_slp_pass::is_compatible_layout): Remove associated comment about zero SLP_TREE_LANES. (vect_optimize_slp_pass::start_choosing_layouts): Iterate over all partition members when looking for potential layouts. Handle existing permutes of fixed-length vectors. gcc/testsuite/ * gcc.dg/vect/bb-slp-pr54400.c: Extend to aarch64. * gcc.dg/vect/bb-slp-layout-18.c: New test.
Diffstat (limited to 'gcc/function.cc')
0 files changed, 0 insertions, 0 deletions