]> git.ipfire.org Git - thirdparty/gcc.git/commit
ifcvt: Improve tests for predicated operations
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 13 Jul 2021 09:17:34 +0000 (10:17 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 13 Jul 2021 09:17:34 +0000 (10:17 +0100)
commit0ae469e8c0ccb93a26bb1e60db6418d6bcced15e
treeed6284907698990f773d1bc984bbed5e8f277677
parentdddb6ffdc5c25264dd75ad82dad8e48a0718d2d9
ifcvt: Improve tests for predicated operations

-msve-vector-bits=128 causes the AArch64 port to list 128-bit Advanced
SIMD as the first-choice mode for vectorisation, with SVE being used for
things that Advanced SIMD can't handle as easily.  However, ifcvt would
not then try to use SVE's predicated FP arithmetic, leading to tests
like TSVC ControlFlow-flt failing to vectorise.

The mask load/store code did try other vector modes, but could also be
improved to make sure that SVEness sticks when computing derived modes.

(Unlike mode_for_vector, related_vector_mode always returns a vector
mode, so there's no need to check VECTOR_MODE_P as well.)

gcc/
* internal-fn.c (vectorized_internal_fn_supported_p): Handle
vector types first.  For scalar types, consider both the preferred
vector mode and the alternative vector modes.
* optabs-query.c (can_vec_mask_load_store_p): Use the same
structure as above, in particular using related_vector_mode
for modes provided by autovectorize_vector_modes.

gcc/testsuite/
* gcc.target/aarch64/sve/cond_arith_6.c: New test.
gcc/internal-fn.c
gcc/optabs-query.c
gcc/testsuite/gcc.target/aarch64/sve/cond_arith_6.c [new file with mode: 0644]