Commit 24ee1384 by Ira Rosen Committed by Ira Rosen

re PR tree-optimization/52091 (ICE: verify_gimple failed)


        PR tree-optimization/52091
        * tree-vectorizer.h (vect_is_simple_use): Add an argument.
        (vect_is_simple_use_1): Likewise.
        * tree-vect-loop.c (vectorizable_reduction): Update calls
        to vect_is_simple_use_1 and vect_is_simple_use.
        (vectorizable_live_operation): Likewise.
        * tree-vect-patterns.c (widened_name_p,
        vect_recog_vector_vector_shift_pattern, check_bool_pattern):
        Likewise.
        * tree-vect-stmts.c (process_use, vect_get_vec_def_for_operand,
        vectorizable_call, vectorizable_conversion,
        vectorizable_assignment, vectorizable_shift,
        vectorizable_operation, vectorizable_store, vectorizable_load):
        Likewise.
        (vect_is_simple_cond): Add an argument, pass it to
        vect_is_simple_use_1.
        (vectorizable_condition): Update calls to vect_is_simple_cond,
        vect_is_simple_use.
        (vect_is_simple_use): Add an argument, the statement in which
        OPERAND is used.  Check that if OPERAND's def stmt is a double
        reduction phi node, the use is a phi node too.
        (vect_is_simple_use_1): Add an argument, pass it to
        vect_is_simple_use.
        * tree-vect-slp.c (vect_get_and_check_slp_defs): Update a call
        to vect_is_simple_use.

From-SVN: r183902
parent 3bbdbe67
2012-02-05 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/52091
* tree-vectorizer.h (vect_is_simple_use): Add an argument.
(vect_is_simple_use_1): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Update calls
to vect_is_simple_use_1 and vect_is_simple_use.
(vectorizable_live_operation): Likewise.
* tree-vect-patterns.c (widened_name_p,
vect_recog_vector_vector_shift_pattern, check_bool_pattern):
Likewise.
* tree-vect-stmts.c (process_use, vect_get_vec_def_for_operand,
vectorizable_call, vectorizable_conversion,
vectorizable_assignment, vectorizable_shift,
vectorizable_operation, vectorizable_store, vectorizable_load):
Likewise.
(vect_is_simple_cond): Add an argument, pass it to
vect_is_simple_use_1.
(vectorizable_condition): Update calls to vect_is_simple_cond,
vect_is_simple_use.
(vect_is_simple_use): Add an argument, the statement in which
OPERAND is used. Check that if OPERAND's def stmt is a double
reduction phi node, the use is a phi node too.
(vect_is_simple_use_1): Add an argument, pass it to
vect_is_simple_use.
* tree-vect-slp.c (vect_get_and_check_slp_defs): Update a call
to vect_is_simple_use.
2012-02-04 Jakub Jelinek <jakub@redhat.com> 2012-02-04 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/52095 PR rtl-optimization/52095
......
2012-02-05 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/52091
* gcc.dg/vect/pr52091.c: New test.
2012-02-04 Jakub Jelinek <jakub@redhat.com> 2012-02-04 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/52113 PR rtl-optimization/52113
......
/* { dg-require-effective-target vect_int } */
/* PR tree-optimization/52091 */
int b, c, d, f;
unsigned h;
extern void abort (void);
int
main ()
{
d = -1;
h = 65;
asm volatile ("" : : : "memory");
for (f = 0; f < 4; f++)
{
h &= (unsigned short) d;
for (b = 0; b <= 1; b++)
{
c = 0;
d &= 1;
}
}
asm volatile ("" : : : "memory");
if (b != 2 || c != 0 || d != 1 || f != 4 || h != 1)
abort ();
return 0;
}
/* { dg-final { cleanup-tree-dump "vect" } } */
/* Loop Vectorization /* Loop Vectorization
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com> and Contributed by Dorit Naishlos <dorit@il.ibm.com> and
Ira Rosen <irar@il.ibm.com> Ira Rosen <irar@il.ibm.com>
...@@ -4486,7 +4486,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -4486,7 +4486,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
if (i == 0 && code == COND_EXPR) if (i == 0 && code == COND_EXPR)
continue; continue;
is_simple_use = vect_is_simple_use_1 (ops[i], loop_vinfo, NULL, is_simple_use = vect_is_simple_use_1 (ops[i], stmt, loop_vinfo, NULL,
&def_stmt, &def, &dt, &tem); &def_stmt, &def, &dt, &tem);
if (!vectype_in) if (!vectype_in)
vectype_in = tem; vectype_in = tem;
...@@ -4507,8 +4507,8 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -4507,8 +4507,8 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
} }
} }
is_simple_use = vect_is_simple_use_1 (ops[i], loop_vinfo, NULL, &def_stmt, is_simple_use = vect_is_simple_use_1 (ops[i], stmt, loop_vinfo, NULL,
&def, &dt, &tem); &def_stmt, &def, &dt, &tem);
if (!vectype_in) if (!vectype_in)
vectype_in = tem; vectype_in = tem;
gcc_assert (is_simple_use); gcc_assert (is_simple_use);
...@@ -4864,14 +4864,14 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -4864,14 +4864,14 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
gimple dummy_stmt; gimple dummy_stmt;
tree dummy; tree dummy;
vect_is_simple_use (ops[!reduc_index], loop_vinfo, NULL, vect_is_simple_use (ops[!reduc_index], stmt, loop_vinfo, NULL,
&dummy_stmt, &dummy, &dt); &dummy_stmt, &dummy, &dt);
loop_vec_def0 = vect_get_vec_def_for_stmt_copy (dt, loop_vec_def0 = vect_get_vec_def_for_stmt_copy (dt,
loop_vec_def0); loop_vec_def0);
VEC_replace (tree, vec_oprnds0, 0, loop_vec_def0); VEC_replace (tree, vec_oprnds0, 0, loop_vec_def0);
if (op_type == ternary_op) if (op_type == ternary_op)
{ {
vect_is_simple_use (op1, loop_vinfo, NULL, &dummy_stmt, vect_is_simple_use (op1, stmt, loop_vinfo, NULL, &dummy_stmt,
&dummy, &dt); &dummy, &dt);
loop_vec_def1 = vect_get_vec_def_for_stmt_copy (dt, loop_vec_def1 = vect_get_vec_def_for_stmt_copy (dt,
loop_vec_def1); loop_vec_def1);
...@@ -5103,7 +5103,8 @@ vectorizable_live_operation (gimple stmt, ...@@ -5103,7 +5103,8 @@ vectorizable_live_operation (gimple stmt,
else else
op = gimple_op (stmt, i + 1); op = gimple_op (stmt, i + 1);
if (op if (op
&& !vect_is_simple_use (op, loop_vinfo, NULL, &def_stmt, &def, &dt)) && !vect_is_simple_use (op, stmt, loop_vinfo, NULL, &def_stmt, &def,
&dt))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "use not simple."); fprintf (vect_dump, "use not simple.");
......
...@@ -109,7 +109,8 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt, ...@@ -109,7 +109,8 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt,
stmt_vinfo = vinfo_for_stmt (use_stmt); stmt_vinfo = vinfo_for_stmt (use_stmt);
loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
if (!vect_is_simple_use (name, loop_vinfo, NULL, def_stmt, &def, &dt)) if (!vect_is_simple_use (name, use_stmt, loop_vinfo, NULL, def_stmt, &def,
&dt))
return false; return false;
if (dt != vect_internal_def if (dt != vect_internal_def
...@@ -133,8 +134,8 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt, ...@@ -133,8 +134,8 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt,
|| (TYPE_PRECISION (type) < (TYPE_PRECISION (*half_type) * 2))) || (TYPE_PRECISION (type) < (TYPE_PRECISION (*half_type) * 2)))
return false; return false;
if (!vect_is_simple_use (oprnd0, loop_vinfo, NULL, &dummy_gimple, &dummy, if (!vect_is_simple_use (oprnd0, *def_stmt, loop_vinfo,
&dt)) NULL, &dummy_gimple, &dummy, &dt))
return false; return false;
return true; return true;
...@@ -1550,7 +1551,8 @@ vect_recog_vector_vector_shift_pattern (VEC (gimple, heap) **stmts, ...@@ -1550,7 +1551,8 @@ vect_recog_vector_vector_shift_pattern (VEC (gimple, heap) **stmts,
!= TYPE_PRECISION (TREE_TYPE (oprnd0))) != TYPE_PRECISION (TREE_TYPE (oprnd0)))
return NULL; return NULL;
if (!vect_is_simple_use (oprnd1, loop_vinfo, NULL, &def_stmt, &def, &dt)) if (!vect_is_simple_use (oprnd1, last_stmt, loop_vinfo, NULL, &def_stmt,
&def, &dt))
return NULL; return NULL;
if (dt != vect_internal_def) if (dt != vect_internal_def)
...@@ -1926,7 +1928,7 @@ check_bool_pattern (tree var, loop_vec_info loop_vinfo) ...@@ -1926,7 +1928,7 @@ check_bool_pattern (tree var, loop_vec_info loop_vinfo)
tree def, rhs1; tree def, rhs1;
enum tree_code rhs_code; enum tree_code rhs_code;
if (!vect_is_simple_use (var, loop_vinfo, NULL, &def_stmt, &def, &dt)) if (!vect_is_simple_use (var, NULL, loop_vinfo, NULL, &def_stmt, &def, &dt))
return false; return false;
if (dt != vect_internal_def) if (dt != vect_internal_def)
......
...@@ -233,8 +233,8 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -233,8 +233,8 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
oprnd = TREE_OPERAND (oprnd, 0); oprnd = TREE_OPERAND (oprnd, 0);
} }
if (!vect_is_simple_use (oprnd, loop_vinfo, bb_vinfo, &def_stmt, &def, if (!vect_is_simple_use (oprnd, NULL, loop_vinfo, bb_vinfo, &def_stmt,
&dt) &def, &dt)
|| (!def_stmt && dt != vect_constant_def)) || (!def_stmt && dt != vect_constant_def))
{ {
if (vect_print_dump_info (REPORT_SLP)) if (vect_print_dump_info (REPORT_SLP))
......
/* Vectorizer /* Vectorizer
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com> Contributed by Dorit Naishlos <dorit@il.ibm.com>
...@@ -808,9 +808,11 @@ extern bool vect_can_advance_ivs_p (loop_vec_info); ...@@ -808,9 +808,11 @@ extern bool vect_can_advance_ivs_p (loop_vec_info);
extern unsigned int current_vector_size; extern unsigned int current_vector_size;
extern tree get_vectype_for_scalar_type (tree); extern tree get_vectype_for_scalar_type (tree);
extern tree get_same_sized_vectype (tree, tree); extern tree get_same_sized_vectype (tree, tree);
extern bool vect_is_simple_use (tree, loop_vec_info, bb_vec_info, gimple *, extern bool vect_is_simple_use (tree, gimple, loop_vec_info,
bb_vec_info, gimple *,
tree *, enum vect_def_type *); tree *, enum vect_def_type *);
extern bool vect_is_simple_use_1 (tree, loop_vec_info, bb_vec_info, gimple *, extern bool vect_is_simple_use_1 (tree, gimple, loop_vec_info,
bb_vec_info, gimple *,
tree *, enum vect_def_type *, tree *); tree *, enum vect_def_type *, tree *);
extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree, extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree,
tree *, tree *, enum tree_code *, tree *, tree *, enum tree_code *,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment