aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-04-30 10:11:47 +0200
committerJakub Jelinek <jakub@redhat.com>2024-04-30 10:11:47 +0200
commit04ef92a62af3a815b86a2037267cd4e747ae225c (patch)
tree0d9105638688af82cbbca68c126b7cdac9cb8631 /gcc/tree-vect-loop.cc
parent3146a92a77f1fccec71a880c7f890a1251aeab41 (diff)
downloadgcc-04ef92a62af3a815b86a2037267cd4e747ae225c.zip
gcc-04ef92a62af3a815b86a2037267cd4e747ae225c.tar.gz
gcc-04ef92a62af3a815b86a2037267cd4e747ae225c.tar.bz2
vect: Adjust vect_transform_reduction assertion [PR114883]
The assertion doesn't allow IFN_COND_MIN/IFN_COND_MAX, which are commutative conditional binary operations like ADD/MUL/AND/IOR/XOR, and can be handled just fine. In particular, we emit vminpd %zmm3, %zmm5, %zmm0{%k2} vminpd %zmm0, %zmm3, %zmm5{%k1} and vmaxpd %zmm3, %zmm5, %zmm0{%k2} vmaxpd %zmm0, %zmm3, %zmm5{%k1} in the vectorized loops of the first and second subroutine. 2024-04-30 Jakub Jelinek <jakub@redhat.com> Hongtao Liu <hongtao.liu@intel.com> PR tree-optimization/114883 * tree-vect-loop.cc (vect_transform_reduction): Allow IFN_COND_MIN and IFN_COND_MAX in the assert. * gfortran.dg/pr114883.f90: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
-rw-r--r--gcc/tree-vect-loop.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index a6cf0a5..29c03c2 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -8505,7 +8505,8 @@ vect_transform_reduction (loop_vec_info loop_vinfo,
{
gcc_assert (code == IFN_COND_ADD || code == IFN_COND_SUB
|| code == IFN_COND_MUL || code == IFN_COND_AND
- || code == IFN_COND_IOR || code == IFN_COND_XOR);
+ || code == IFN_COND_IOR || code == IFN_COND_XOR
+ || code == IFN_COND_MIN || code == IFN_COND_MAX);
gcc_assert (op.num_ops == 4
&& (op.ops[reduc_index]
== op.ops[internal_fn_else_index ((internal_fn) code)]));