This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] tree level if-conversion for vectorizer


Richard Henderson <rth@redhat.com> wrote on 31/08/2004 09:36:08:

> On Mon, Aug 30, 2004 at 10:40:16PM -0700, Devang Patel wrote:
> > OK. But as you say, how to handle PARM_DECL ?
>
>    T3 = P ? T2 : T1.
>
> In the case of PARM_DECL, T1 as the default definition *does* have
> a defined meaning -- the value of the parameter as given by the caller.
>
> >    if (COND)
> >       A[i] = x;
> >
> > do you think, we should introduce temp. here, like
> >
> >    t = A[i];
> >    if (COND)
> >       t = x;
> >    A[i] = t;
>
> For a conditional store, you must either do this or fail the transform.
> There are no other alternatives.

There may be another alternative for conditional stores. If the compiler
has some scratch-pad address, into which it can always store without
causing any trouble, we could do

      t = (COND ? &A[i] : scratch-pad-address)
      *t = x

which also applies to conditional loads.

Ayal.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]