diff options
| author | Artemiy Volkov <artemiy.volkov@arm.com> | 2025-11-01 17:17:15 +0000 |
|---|---|---|
| committer | Artemiy Volkov <artemiy.volkov@arm.com> | 2025-11-05 10:38:51 +0000 |
| commit | 470411f44f51d9ef85bfcf3a8f9cb25344dd243f (patch) | |
| tree | eda10a564a74638d0e59aa5da17f58b5e0145c36 /libgrust/rustc-lib/stdarch/crates/std_detect | |
| parent | 7c4f8ae20cc09e8732739ac839c845ba8c2991c0 (diff) | |
| download | gcc-470411f44f51d9ef85bfcf3a8f9cb25344dd243f.zip gcc-470411f44f51d9ef85bfcf3a8f9cb25344dd243f.tar.gz gcc-470411f44f51d9ef85bfcf3a8f9cb25344dd243f.tar.bz2 | |
forwprop: allow subvectors in simplify_vector_constructor ()
This is an attempt to fix
https://gcc.gnu.org/pipermail/gcc-patches/2025-October/697879.html in the
middle-end; the motivation in that patch was to teach gcc to compile:
int16x8_t foo (int16x8_t x)
{
return vcombine_s16 (vget_high_s16 (x), vget_low_s16 (x));
}
into one instruction:
foo:
ext v0.16b, v0.16b, v0.16b, #8
ret
rather than the two we are generating now:
foo:
dup d31, v0.d[1]
uzp1 v0.2d, v31.2d, v0.2d
ret
Instead of adding a define_insn in the backend, this patch relaxes the
precondition of tree-ssa-forwprop.cc:simplify_vector_constructor () to
accept subvectors as constructor elements. During initial argument
processing (ll. 3817-3916), subvectors are decomposed into individual
elements before populating the ELTS array; this allows the rest of the
function to remain unchanged. Special handling is also implemented for
constant and splat subvector elements of a constructor (the latter with
the use of ssa_uniform_vector_p () from tree-vect-generic.cc, which this
patch moves to tree.cc).
Add GIMPLE tests to gcc.dg/tree-ssa demonstrating the intended behavior
with various combinations of subvectors as constructor arguments,
including constant and splat subvectors; also add some aarch64-specific
tests to show that the change leads to us picking the "ext" instruction
for the resulting VEC_PERM_EXPR.
Bootstrapped and regtested on aarch64 and x86_64, regtested on aarch64_be.
gcc/ChangeLog:
* tree-ssa-forwprop.cc (simplify_vector_constructor): Support
vector constructor elements.
* tree-vect-generic.cc (ssa_uniform_vector_p): Make non-static and
move ...
* tree.cc (ssa_uniform_vector_p): ... here.
* tree.h (ssa_uniform_vector_p): Declare it.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/forwprop-43.c: New test.
* gcc.target/aarch64/simd/combine_ext.c: New test.
Diffstat (limited to 'libgrust/rustc-lib/stdarch/crates/std_detect')
0 files changed, 0 insertions, 0 deletions
