aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-04-09 10:40:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-09 10:40:14 +0000
commitb690cc0f331d0f63e2de4f0aa2e3883444cfead2 (patch)
treed8ea3d9ce37b8e002c9ace43434d9d7c2b6fca9c /gcc/tree-vect-patterns.c
parentced572837c918c138eee3e901d4b11a9996d7f07 (diff)
downloadgcc-b690cc0f331d0f63e2de4f0aa2e3883444cfead2.zip
gcc-b690cc0f331d0f63e2de4f0aa2e3883444cfead2.tar.gz
gcc-b690cc0f331d0f63e2de4f0aa2e3883444cfead2.tar.bz2
tree-vectorizer.h (struct _stmt_vec_info): Document that vectype is the type of the LHS.
2010-04-09 Richard Guenther <rguenther@suse.de> * tree-vectorizer.h (struct _stmt_vec_info): Document that vectype is the type of the LHS. (supportable_widening_operation, supportable_narrowing_operation): Get both input and output vector types as arguments. (vect_is_simple_use_1): Declare. (get_same_sized_vectype): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Set STMT_VINFO_VECTYPE to the vector type of the def. (vectorizable_reduction): Adjust. * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Adjust. Specify the output vector type. (vect_pattern_recog_1): Adjust. * tree-vect-stmts.c (get_same_sized_vectype): New function. (vectorizable_call): Adjust. (vectorizable_conversion): Likewise. (vectorizable_operation): Likewise. (vectorizable_type_demotion): Likewise. (vectorizable_type_promotion): Likewise. (vect_analyze_stmt): Set STMT_VINFO_VECTYPE to the vector type of the def. (vect_is_simple_use_1): New function. (supportable_widening_operation): Get both input and output vector types. (supportable_narrowing_operation): Likewise. * tree-vect-slp.c (vect_schedule_slp_instance): Adjust. From-SVN: r158157
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 37b0633..55b9d50 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -362,7 +362,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
tree oprnd0, oprnd1;
tree type, half_type0, half_type1;
gimple pattern_stmt;
- tree vectype;
+ tree vectype, vectype_out;
tree dummy;
tree var;
enum tree_code dummy_code;
@@ -405,14 +405,16 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
/* Check target support */
vectype = get_vectype_for_scalar_type (half_type0);
+ vectype_out = get_vectype_for_scalar_type (type);
if (!vectype
- || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype,
+ || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt,
+ vectype_out, vectype,
&dummy, &dummy, &dummy_code,
&dummy_code, &dummy_int, &dummy_vec))
return NULL;
*type_in = vectype;
- *type_out = NULL_TREE;
+ *type_out = vectype_out;
/* Pattern supported. Create a stmt to be used to replace the pattern: */
var = vect_recog_temp_ssa_var (type, NULL);
@@ -677,7 +679,9 @@ vect_pattern_recog_1 (
{
/* No need to check target support (already checked by the pattern
recognition function). */
- pattern_vectype = type_in;
+ if (type_out)
+ gcc_assert (VECTOR_MODE_P (TYPE_MODE (type_out)));
+ pattern_vectype = type_out ? type_out : type_in;
}
else
{
@@ -686,9 +690,14 @@ vect_pattern_recog_1 (
optab optab;
/* Check target support */
- pattern_vectype = get_vectype_for_scalar_type (type_in);
- if (!pattern_vectype)
- return;
+ type_in = get_vectype_for_scalar_type (type_in);
+ if (!type_in)
+ return;
+ if (type_out)
+ type_out = get_vectype_for_scalar_type (type_out);
+ else
+ type_out = type_in;
+ pattern_vectype = type_out;
if (is_gimple_assign (pattern_stmt))
code = gimple_assign_rhs_code (pattern_stmt);
@@ -698,15 +707,12 @@ vect_pattern_recog_1 (
code = CALL_EXPR;
}
- optab = optab_for_tree_code (code, pattern_vectype, optab_default);
- vec_mode = TYPE_MODE (pattern_vectype);
+ optab = optab_for_tree_code (code, type_in, optab_default);
+ vec_mode = TYPE_MODE (type_in);
if (!optab
|| (icode = optab_handler (optab, vec_mode)->insn_code) ==
CODE_FOR_nothing
- || (type_out
- && (!get_vectype_for_scalar_type (type_out)
- || (insn_data[icode].operand[0].mode !=
- TYPE_MODE (get_vectype_for_scalar_type (type_out))))))
+ || (insn_data[icode].operand[0].mode != TYPE_MODE (type_out)))
return;
}