On Thu, 15 Dec 2011, Ira Rosen wrote: > > > Jakub Jelinek <ja...@redhat.com> wrote on 15/12/2011 09:02:57 AM: > > > On Thu, Dec 15, 2011 at 08:32:26AM +0200, Ira Rosen wrote: > > > > + cond = build2 (LT_EXPR, boolean_type_node, oprnd0, build_int_cst > > > > (itype, 0)); > > > > + gsi = gsi_for_stmt (last_stmt); > > > > + if (rhs_code == TRUNC_DIV_EXPR) > > > > + { > > > > + tree var = vect_recog_temp_ssa_var (itype, NULL); > > > > + def_stmt > > > > + = gimple_build_assign_with_ops3 (COND_EXPR, var, cond, > > > > + fold_build2 (MINUS_EXPR, itype, > > > > + oprnd1, > > > > + build_int_cst (itype, > > > > + 1)), > > > > + build_int_cst (itype, 0)); > > > > + gsi_insert_before (&gsi, def_stmt, GSI_SAME_STMT); > > > > > > Hmm, you are inserting pattern stmts. This was causing some mess in the > > > past as explained here > > > http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00801.html. Maybe you can > use > > > STMT_VINFO_PATTERN_DEF_STMT to keep a chain of def_stmts? > > > > Yes, I know, but STMT_VINFO_PATTERN_DEF_STMT contains a single gimple > stmt, > > while I need here several def stmts. > > > + S3 y_t = b_t < 0 ? N - 1 : 0; > > + S2 x_t = b_t + y_t; > > + S1' a_t = x_t >> log2 (N); > > I was talking about putting S3 in STMT_VINFO_PATTERN_DEF_STMT of S2. > > > I think it can't cause problems in > > this case, the stmts will be easily DCEd. > > But it's really ugly to insert part of pattern sequence, don't you think?
It indeed is. The issue in the past was ICEing with -fno-tree-dce when the pattern stmts did not have regular RTL expansion support and the vectorization didn't trigger in the end. We should really avoid inserting the pattern stmts. Richard.