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: Loop to builtin call pass (builtinizer)


Tomas Bily <tbily@suse.cz> wrote on 03/07/2007 19:29:47:

> Hi Dorit,
>
>  I agree that a lot of analyzes in vectorizer and builtinizer are same
> or very similar. So, I can try to merge it to vectorizer. I have first
> few questions about it:
>
>  If I undertand it properly vectorizer can recognize same patterns (x
> [i] = constant, x [i] = y [i]) too. If I add builtins (bltn) pattern
> recognizers to vectorizer there will be two different matches for same
> stmts. How can I handle this ? Add bltn pattern recognition to current
> functions and determine whether there is enabled
> -ftree-loop-builtinize switch (or some another switch) and then use
> bltn part of recognition ? Or let bltn pattern recognizers in new
> functions and add some check to vect pattern recognition functions if
> there is match on current stmt and skip recognition ?
>

So the way the vectorizer currently works, if a certain pattern is
recognized during the pattern recognition pass, the assumption is that it
is better to vectorize the pattern rather than directly vectorizing the
original stmts that constitute the pattern. This can be changed in the
future, when our cost-model is extended to help decide between different
alternatives for vectorizing a loop. In the meantime, if the
pattern-detector recognized the stmt "x [i] = 0;" as the pattern
"builtin_memset", is will not consider vectorizing the stmt "x [i] = 0;",
only the pattern "builtin_memset". So there will not be a problem of two
different matches for same stmt.

HTH,
dorit

>  Greetings
>
>  Tomas
>
> > Hi Tomas,
> >
> > I think this is a good transformation to have.
> >
> > It's very evident, however, that there's *a lot* of duplication with
the
> > vectorizer, both in code, in the data structures that are used, and
also in
> > recomputing a lot of the same things (almost all the passes you
describe
> > above are also done in the vectorizer). I think there's room to
consider to
> > reuse the vectorizer pass, and just add the memset and memcopy patterns
as
> > yet another two patterns that will be detected during the
> > pattern-recognition pass that the vectorizer already does (you already
> > implemented it almost exactly like the vectorizer's pattern recognition
so
> > it should be easy to plug it into the vectorizer's pattern recognition
> > engine). There are of-course some differences that would need to be
> > handled, but I think it would be worth while to put some thought into
how
> > these could be integrated into the vectorizer to avoid having to run a
> > whole separate pass for a lot of the same analyses. I could help with
> > looking into how to revise the patch to incorporate it into the
vectorizer.
> >
> > dorit


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