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: Ira Rosen <IRAR at il dot ibm dot com>
- To: Jakub Jelinek <jakub at redhat 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 10:05:55 +0200
- 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> <20111215070257.GL1957@tyan-ft48-01.lab.bos.redhat.com>
Jakub Jelinek <jakub@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?
Ira
> We could turn
> STMT_VINFO_PATTERN_DEF_STMT into a gimple_seq perhaps, will try that and
see
> how invasive that would be.
>
> Jakub
>