]> gcc.gnu.org Git - gcc.git/commit
vect: Check gather/scatter offset types [PR108316]
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 8 Feb 2023 13:40:29 +0000 (13:40 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 8 Feb 2023 13:40:29 +0000 (13:40 +0000)
commit740a3be7df29b280f39a04c441fd4917af4eef5e
tree25cb8a000f468c1295b8534db91a636c8a3d4038
parentad2bd0ad0413c2448fee0d4a062dd52ca8a75e8c
vect: Check gather/scatter offset types [PR108316]

The gather/scatter support can over-widen an offset if the target
requires it, but this relies on using a pattern sequence to add
the widening conversion.  That failed in the testcase because an
earlier pattern (bool) took priority.

I think we should allow patterns to be applied to other patterns,
but that's quite an invasive change and isn't suitable for stage 4.
This patch instead punts if the offset type doesn't match the
expected one.

If we switched to using the SLP representation for everything,
we would probably handle both patterns by rewriting the graph,
which should be much easier.

gcc/
PR tree-optimization/108316
* tree-vect-stmts.cc (get_load_store_type): When using
internal functions for gather/scatter, make sure that the type
of the offset argument is consistent with the offset vector type.

gcc/testsuite/
PR tree-optimization/108316
* gcc.dg/vect/pr108316.c: New test.
gcc/testsuite/gcc.dg/vect/pr108316.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc
This page took 0.069877 seconds and 6 git commands to generate.