This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: Vectorizer question: DIV to RSHIFT conversion
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ira Rosen <IRAR at il dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Richard Guenther <rguenther at suse dot de>
- Date: Thu, 15 Dec 2011 08:02:57 +0100
- Subject: Re: [PATCH] Re: Vectorizer question: DIV to RSHIFT conversion
- References: <CAGs3RfvOFgfVQ=PkYM+CtsgBL99k_gF_R-Yet3oFLHU7b-k5jQ@mail.gmail.com> <alpine.LNX.2.00.1112131406430.4527@zhemvz.fhfr.qr> <20111213132128.GZ1957@tyan-ft48-01.lab.bos.redhat.com> <CAGs3Rfucj9C7DqcjjJOzor0X=Yf_DT1av1T6cZdfZkmOsS+VNw@mail.gmail.com> <20111213134741.GA1957@tyan-ft48-01.lab.bos.redhat.com> <CAGs3RfvkZW+k-NmqHkNx7V42zOV4SCL-OXVLUr7M-iHs_HVAYA@mail.gmail.com> <20111214122513.GD1957@tyan-ft48-01.lab.bos.redhat.com> <OF2D496C61.FB8675EE-ONC2257967.0022CDDB-C2257967.0023EE06@il.ibm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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. I think it can't cause problems in
this case, the stmts will be easily DCEd. We could turn
STMT_VINFO_PATTERN_DEF_STMT into a gimple_seq perhaps, will try that and see
how invasive that would be.
Jakub