This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, vectorizer] Fix PR tree-optimization/37174: ICE in tree-vectorizer.h
- From: Ira Rosen <IRAR at il dot ibm dot com>
- To: Dorit Nuzman <DORIT at il dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2008 13:47:32 +0300
- Subject: Re: [patch, vectorizer] Fix PR tree-optimization/37174: ICE in tree-vectorizer.h
Dorit Nuzman/Haifa/IBM wrote on 21/08/2008 11:28:23:
> it's ok, except we usually do that by explicitly checking if the
> stmt is outside the loop, like so:
> bb = gimple_bb (*def_stmt);
> if (!flow_bb_inside_loop_p (loop, bb))
> ....
>
> By relying on the def-type ('dt') being vect_loop_def:
>
> > - if (def_stmt && vinfo_for_stmt (def_stmt)
> > + if (def_stmt && dt[i] == vect_loop_def && vinfo_for_stmt
(def_stmt)
> > && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt)))
>
> ...you may miss patterns that involve other def-types, like
> reduction, induction, etc. It's probably ok for now, cause SLP
> doesn't supports reduction/induction anyhow, but we would probably
> want to change that in the future.
OK, I am now testing:
--- tree-vect-analyze.c 2008-08-20 15:18:54.000000000 +0300
+++ tree-vect-analyze.c.p 2008-08-21 12:23:31.000000000 +0300
@@ -2508,6 +2508,7 @@ vect_get_and_check_slp_defs (loop_vec_in
stmt_vec_info stmt_info =
vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node),
0));
enum gimple_rhs_class rhs_class;
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
rhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (stmt));
number_of_oprnds = gimple_num_ops (stmt) - 1; /* RHS only */
@@ -2531,7 +2532,9 @@ vect_get_and_check_slp_defs (loop_vec_in
/* Check if DEF_STMT is a part of a pattern and get the def stmt
from);
the pattern. Check that all the stmts of the node are in the
pattern. */
- if (def_stmt && vinfo_for_stmt (def_stmt)
+ if (def_stmt
+ && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
+ && vinfo_for_stmt (def_stmt)
&& STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt)))
{
if (!*first_stmt_dt0)
Thanks,
Ira