]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect/ifcvt: Add vec_cond fallback and check for vector versioning.
authorRobin Dapp <rdapp@ventanamicro.com>
Mon, 6 Nov 2023 10:24:37 +0000 (11:24 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Tue, 7 Nov 2023 21:33:52 +0000 (22:33 +0100)
commitfd940d248bfccb6994794152681dc4c693160919
tree92ef48d71aa921bbff8525139d4e5b5308c35e25
parent8f2a59c2629f634e0ea7b2bcc4443fd57c2a0e84
vect/ifcvt: Add vec_cond fallback and check for vector versioning.

This restricts tree-ifcvt to only create COND_OPs when we versioned the
loop for vectorization.  Apart from that it re-creates a VEC_COND_EXPR
in vect_expand_fold_left if we emitted a COND_OP.

gcc/ChangeLog:

PR tree-optimization/112361
PR target/112359
PR middle-end/112406

* tree-if-conv.cc (convert_scalar_cond_reduction): Remember if
loop was versioned and only then create COND_OPs.
(predicate_scalar_phi): Do not create COND_OP when not
vectorizing.
* tree-vect-loop.cc (vect_expand_fold_left): Re-create
VEC_COND_EXPR.
(vectorize_fold_left_reduction): Pass mask to
vect_expand_fold_left.

gcc/testsuite/ChangeLog:

* gcc.dg/pr112359.c: New test.
gcc/testsuite/gcc.dg/pr112359.c [new file with mode: 0644]
gcc/tree-if-conv.cc
gcc/tree-vect-loop.cc