This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: auto vectorization in gcc
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Dorit Naishlos <DORIT at il dot ibm dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, David Edelsohn <dje at watson dot ibm dot com>
- Date: 17 Jul 2003 10:09:13 -0400
- Subject: Re: auto vectorization in gcc
- Organization: Red Hat Canada
- References: <OF129DBCCF.99C6474B-ONC2256D66.004608FF-C2256D66.00461C31@telaviv.ibm.com>
On Thu, 2003-07-17 at 08:45, Dorit Naishlos wrote:
> We are planning to implement auto-vectorization targeting vector
> extensions such as AltiVec.
>
Cool!
> (a) the tree-SSA branch is preparing the infrastructure for
> auto-vectorization
> (b) the task of auto-vectorizaiton will probably be divided between
> the RTL level and the tree level
> (c) since the tree-level is machine independent, actual vectorization
> will take place in the RTL level
> (d) the tree-SSA branch will perform data-dependence analysis and
> loop transformations to increase vectorizability of loops,
> and somehow pass on the information to the RTL level.
>
> How far is this from what has really been envisioned?
>
That's pretty much the idea we had in mind.
> Is it indeed the case that no target specific information will be
> available at the tree level, deferring transformations that rely on
> such information to the RTL level?
>
No. I think we will need to have some target information at the tree
level. But it's not clear how much or how detailed, yet.
> (for example, detecting idioms
> like "substract and saturate" if they are supported, and unrolling
> or blocking the iterations according to the vector length, etc)?
>
Something along those lines, yes.
> We would like to start making progress on auto-vectorization
> right away, and we're trying to figure out what's the best way to do
> that. On one hand, we don't want to duplicate work, and we want to
> take a path that could take advantage of the infrastructure that is
> being developed (tree-SSA branch, rtlopt branch), (and hopefully
> would be merged into the main trunk in the future).
>
I don't think there's much risk in duplicating effort at the moment.
I'm not aware of anybody working on vectorization today.
> What is your opinion on the correct mode of work here?
>
Since you want to start from the bottom up, I think the rtlopt branch
may be a better starting point. At some point both tree-ssa and rtlopt
should merge, but I don't really know what the status of rtlopt is.
Jan? Zdenek?
Starting on the tree-ssa branch would also be possible, particularly if
you start with SLP. There are some issues with RTL loops in tree-ssa
and you would need to implement some of the loop transformations at the
tree level, but we need to do that at some point, anyway.
> After the above questions are cleared out, the remaining major
> design decision is which vectorization scheme to follow -
> straight-line code vectorization (Superword Level Parallism (SLP)
> http://www.acm.org/pubs/citations/proceedings/pldi/349299/p145-larsen/),
> or the classic loop based vectorization, and how to partition it
> between the tree-level and the RTL level.
>
This is what I had in mind as a starting point. It's simple and doesn't
involve much of the heavy data dependency work from traditional
vectorization.
Diego.