From 2dab46d5fc9f95de16bd9bf0f219be5e64324d1f Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Thu, 10 Dec 2015 11:23:50 +0000 Subject: [PATCH] tree-vect-stmts.c (vectorizable_assignment): Support useless boolean conversion. gcc/ * tree-vect-stmts.c (vectorizable_assignment): Support useless boolean conversion. From-SVN: r231503 --- gcc/ChangeLog | 5 +++++ gcc/tree-vect-stmts.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f225485359..aca8e944477 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-10 Ilya Enkovich + + * tree-vect-stmts.c (vectorizable_assignment): Support + useless boolean conversion. + 2015-12-10 Alan Lawrence * doc/install.texi: Add note against GNAT 4.8 on ARM targets. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 56aa2c8cce5..5377d1553c6 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -4310,7 +4310,12 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi, /* But a conversion that does not change the bit-pattern is ok. */ && !((TYPE_PRECISION (TREE_TYPE (scalar_dest)) > TYPE_PRECISION (TREE_TYPE (op))) - && TYPE_UNSIGNED (TREE_TYPE (op)))) + && TYPE_UNSIGNED (TREE_TYPE (op))) + /* Conversion between boolean types of different sizes is + a simple assignment in case their vectypes are same + boolean vectors. */ + && (!VECTOR_BOOLEAN_TYPE_P (vectype) + || !VECTOR_BOOLEAN_TYPE_P (vectype_in))) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, -- 2.30.2