aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-06-04 14:17:21 +0200
committerRichard Biener <rguenther@suse.de>2020-06-04 14:38:09 +0200
commita3a70bf6690e310fb1d4afa4b3dd1b19ddd0e2f4 (patch)
treed8d99bdbe301c1007e5e81b3285f9f83ddc77cfb /gcc/tree-vect-loop.c
parent43088bb4dadd3d14b6b594c5f9363fe879f3d7f7 (diff)
downloadgcc-a3a70bf6690e310fb1d4afa4b3dd1b19ddd0e2f4.zip
gcc-a3a70bf6690e310fb1d4afa4b3dd1b19ddd0e2f4.tar.gz
gcc-a3a70bf6690e310fb1d4afa4b3dd1b19ddd0e2f4.tar.bz2
Simplify SLP code wrt SLP_TREE_DEF_TYPE
The following removes the ugly pushing of SLP_TREE_DEF_TYPE to stmt_infos and instead makes sure to handle invariants fully in vect_is_simple_use plus adjusting a few places I refrained from touching when enforcing vector types for them. It also simplifies building SLP nodes with all external operands from scalars by not doing that in the parent but instead not building those from the start. That also gets rid of vect_update_all_shared_vectypes. 2020-06-04 Richard Biener <rguenther@suse.de> * tree-vect-slp.c (vect_update_all_shared_vectypes): Remove. (vect_build_slp_tree_2): Simplify building all external op nodes from scalars. (vect_slp_analyze_node_operations): Remove push/pop of STMT_VINFO_DEF_TYPE. (vect_schedule_slp_instance): Likewise. * tree-vect-stmts.c (ect_check_store_rhs): Pass in the stmt_info, use the vect_is_simple_use overload combining SLP and stmt_info analysis. (vect_is_simple_cond): Likewise. (vectorizable_store): Adjust. (vectorizable_condition): Likewise. (vect_is_simple_use): Fully handle invariant SLP nodes here. Amend stmt_info operand extraction with COND_EXPR and masked stores. * tree-vect-loop.c (vectorizable_reduction): Deal with COND_EXPR representation ugliness.
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 3c5c0ea..ad26663 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -6197,6 +6197,12 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
gcc_assert (SLP_TREE_REPRESENTATIVE (slp_for_stmt_info) == stmt_info);
}
slp_tree *slp_op = XALLOCAVEC (slp_tree, op_type);
+ /* We need to skip an extra operand for COND_EXPRs with embedded
+ comparison. */
+ unsigned opno_adjust = 0;
+ if (code == COND_EXPR
+ && COMPARISON_CLASS_P (gimple_assign_rhs1 (stmt)))
+ opno_adjust = 1;
for (i = 0; i < op_type; i++)
{
/* The condition of COND_EXPR is checked in vectorizable_condition(). */
@@ -6207,7 +6213,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
enum vect_def_type dt;
tree op;
if (!vect_is_simple_use (loop_vinfo, stmt_info, slp_for_stmt_info,
- i, &op, &slp_op[i], &dt, &tem,
+ i + opno_adjust, &op, &slp_op[i], &dt, &tem,
&def_stmt_info))
{
if (dump_enabled_p ())