Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change vector_shuffle into a variadic SDNode #3329

Closed
llvmbot opened this issue Oct 27, 2008 · 5 comments
Closed

Change vector_shuffle into a variadic SDNode #3329

llvmbot opened this issue Oct 27, 2008 · 5 comments
Labels

Comments

@llvmbot
Copy link
Collaborator

@llvmbot llvmbot commented Oct 27, 2008

Bugzilla Link 2957
Resolution FIXED
Resolved on Apr 24, 2009 00:54
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @sunfishcode

Extended Description

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 :)

@lattner
Copy link
Collaborator

@lattner lattner commented Oct 27, 2008

Would it be better to introduce a ShuffleSDNode that kept the shuffle mask as an array of integers?

@lattner
Copy link
Collaborator

@lattner lattner commented Oct 27, 2008

In any case, either solution would be dramatically better than the current shuffle with buildvector as mask!

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Oct 28, 2008

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).

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Apr 24, 2009

@lattner
Copy link
Collaborator

@lattner lattner commented Apr 24, 2009

woohoo

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants