summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-06-21 11:02:38 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-06-21 11:02:38 +0000
commit7b7ec6c51efe53786f0efdc7c9127ba8221331fd (patch)
treedc57e81a877b41014966d99e0e48a413f39a385a /gcc/tree-vect-stmts.c
parentced4d0e333a3123208df5950b6e5fc41775666f8 (diff)
downloadgcc-7b7ec6c51efe53786f0efdc7c9127ba8221331fd.tar.gz
re PR tree-optimization/49483 (unable to vectorize code equivalent to "scalbnf")
2011-06-21 Richard Guenther <rguenther@suse.de> PR tree-optimization/49483 * tree-vect-stmts.c (vectorizable_assignment): Also handle VIEW_CONVERT_EXPR conversions. * gcc.dg/vect/vect-120.c: New testcase. From-SVN: r175252
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 6a5ba22d42a..f9b96391081 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -2089,6 +2089,9 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
else
return false;
+ if (code == VIEW_CONVERT_EXPR)
+ op = TREE_OPERAND (op, 0);
+
if (!vect_is_simple_use_1 (op, loop_vinfo, bb_vinfo,
&def_stmt, &def, &dt[0], &vectype_in))
{
@@ -2099,7 +2102,8 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
/* We can handle NOP_EXPR conversions that do not change the number
of elements or the vector size. */
- if (CONVERT_EXPR_CODE_P (code)
+ if ((CONVERT_EXPR_CODE_P (code)
+ || code == VIEW_CONVERT_EXPR)
&& (!vectype_in
|| TYPE_VECTOR_SUBPARTS (vectype_in) != nunits
|| (GET_MODE_SIZE (TYPE_MODE (vectype))
@@ -2134,7 +2138,8 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
/* Arguments are ready. create the new vector stmt. */
FOR_EACH_VEC_ELT (tree, vec_oprnds, i, vop)
{
- if (CONVERT_EXPR_CODE_P (code))
+ if (CONVERT_EXPR_CODE_P (code)
+ || code == VIEW_CONVERT_EXPR)
vop = build1 (VIEW_CONVERT_EXPR, vectype, vop);
new_stmt = gimple_build_assign (vec_dest, vop);
new_temp = make_ssa_name (vec_dest, new_stmt);