diff options
author | Ilya Enkovich <enkovich.gnu@gmail.com> | 2015-11-13 11:45:25 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-11-13 11:45:25 +0000 |
commit | e4af0bc4650f371dc553bccd03d5dfe2704bc660 (patch) | |
tree | ad5f4cf9d3ab2efb6a3c4da48f6a2d31e1790633 /gcc/tree-vect-loop.c | |
parent | f7259dd4be3a6edba6035e2d7c580ee11ed16800 (diff) | |
download | gcc-e4af0bc4650f371dc553bccd03d5dfe2704bc660.zip gcc-e4af0bc4650f371dc553bccd03d5dfe2704bc660.tar.gz gcc-e4af0bc4650f371dc553bccd03d5dfe2704bc660.tar.bz2 |
tree-vect-loop.c (vect_determine_vectorization_factor): Check mix of boolean and integer vectors in a single statement.
gcc/
* tree-vect-loop.c (vect_determine_vectorization_factor): Check
mix of boolean and integer vectors in a single statement.
* tree-vect-slp.c (vect_mask_constant_operand_p): New.
(vect_get_constant_vectors): Use vect_mask_constant_operand_p to
determine constant type.
* tree-vect-stmts.c (vectorizable_comparison): Provide vectype
for loop invariants.
gcc/testsuite/
* g++.dg/vect/simd-bool-comparison-1.cc: New test.
* g++.dg/vect/simd-bool-comparison-2.cc: New test.
From-SVN: r230309
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 4630c86..80937ec 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -649,7 +649,32 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo) } return false; } + else if (VECTOR_BOOLEAN_TYPE_P (mask_type) + != VECTOR_BOOLEAN_TYPE_P (vectype)) + { + if (dump_enabled_p ()) + { + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "not vectorized: mixed mask and " + "nonmask vector types in statement, "); + dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, + mask_type); + dump_printf (MSG_MISSED_OPTIMIZATION, " and "); + dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, + vectype); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); + } + return false; + } } + + /* We may compare boolean value loaded as vector of integers. + Fix mask_type in such case. */ + if (mask_type + && !VECTOR_BOOLEAN_TYPE_P (mask_type) + && gimple_code (stmt) == GIMPLE_ASSIGN + && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison) + mask_type = build_same_sized_truth_vector_type (mask_type); } /* No mask_type should mean loop invariant predicate. |