diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-08-14 18:35:53 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-08-20 00:26:19 -0700 |
commit | 70c50c87273d940918225d5c6b03f1ccfb6f978e (patch) | |
tree | c6f494c33f024dc9eff8f3151e7294d0d98489fc /gcc/loop-unroll.cc | |
parent | 1e3003ca0865329207591896534a6f4fcfde62aa (diff) | |
download | gcc-70c50c87273d940918225d5c6b03f1ccfb6f978e.zip gcc-70c50c87273d940918225d5c6b03f1ccfb6f978e.tar.gz gcc-70c50c87273d940918225d5c6b03f1ccfb6f978e.tar.bz2 |
MATCH: Sink convert for vec_cond
Convert be sinked into a vec_cond if both sides
fold. Unlike other unary operations, we need to check that we still can handle
this vec_cond's first operand is the same as the new truth type.
I tried a few different versions of this patch:
view_convert to the new truth_type but that does not work as we always support all vec_cond
afterwards.
using expand_vec_cond_expr_p; but that would allow too much.
I also tried to see if view_convert can be handled here but we end up with:
_3 = VEC_COND_EXPR <_2, { Nan(-1), Nan(-1), Nan(-1), Nan(-1) }, { 0.0, 0.0, 0.0, 0.0 }>;
Which isel does not know how to handle as just being a view_convert from `vector(4) <signed-boolean:32>`
to `vector(4) float` and causes a regression with `g++.target/i386/pr88152.C`
Note, in the case of the SVE testcase, we will sink negate after the convert and be able
to remove a few extra instructions in the end.
Also with this change gcc.target/aarch64/sve/cond_unary_5.c will now pass.
Committed as approved after a bootstrapped and tested on x86_64-linux-gnu and aarch64-linux-gnu.
gcc/ChangeLog:
PR tree-optimization/111006
PR tree-optimization/110986
* match.pd: (op(vec_cond(a,b,c))): Handle convert for op.
gcc/testsuite/ChangeLog:
PR tree-optimization/111006
* gcc.target/aarch64/sve/cond_convert_7.c: New test.
Diffstat (limited to 'gcc/loop-unroll.cc')
0 files changed, 0 insertions, 0 deletions