First Last Prev Next    No search results available
Details
: Change vector_shuffle into a variadic SDNode
Bug#: 2957
: new-bugs
: new bugs
Status: RESOLVED
Resolution: FIXED
: Other
: Linux
: unspecified
: P2
: enhancement
: ---

:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Duncan Sands <baldrick@free.fr>
Assigned To: Unassigned LLVM Bugs <unassignedbugs@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2008-10-27 10:06
Currently codegen represents a vector_shuffle
as a node with three operands.  The third operand
is a mask, which *must* be a BUILD_VECTOR node of
constant integers (a different kind of node that
produces a result of the right vector type isn't
good enough).  This causes problems during type
legalization because it is not always possible to
create a legal BUILD_VECTOR usable as the vector
shuffle mask.  (LegalizeDAG ignores the legality
or not of the mask argument, but LegalizeTypes
insists on legalizing the types of all nodes,
which I think is the right thing to do).

I think the best plan is to incorporate the mask
directly into the vector shuffle node, by turning
into a node with 2+N operands: the first two the
same as now, followed by the N mask elements.

This seems fairly straightforward to do, but involves
a lot of tedious work.  I don't have time for it right
now so I've opened this PR in the hope that someone
else will take it on :)
------- Comment #1 From Chris Lattner 2008-10-27 13:10:41 -------
Would it be better to introduce a ShuffleSDNode that kept the shuffle mask as
an array of integers?
------- Comment #2 From Chris Lattner 2008-10-27 13:11:07 -------
In any case, either solution would be dramatically better than the current
shuffle with buildvector as mask!
------- Comment #3 From Duncan Sands 2008-10-28 05:51:10 -------
Lots of places want to examine masks to see if they have special
properties etc.  One advantage of a special node type containing
the mask as a vector is that just the mask can be passed to such
routines rather than the whole node (with the variadic node scheme
you would have to pass the entire shuffle vector node, which is
kind of sucky).
------- Comment #5 From Chris Lattner 2009-04-24 00:54:24 -------
woohoo

First Last Prev Next    No search results available