[llvm-commits] [llvm] r47670 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.h LegalizeTypesSplit.cpp
Chris Lattner
clattner at apple.com
Wed Feb 27 09:21:31 PST 2008
On Feb 27, 2008, at 5:03 AM, Duncan Sands wrote:
> Author: baldrick
> Date: Wed Feb 27 07:03:44 2008
> New Revision: 47670
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47670&view=rev
> Log:
> LegalizeTypes support for legalizing the mask
> operand of a VECTOR_SHUFFLE. The mask is a
> vector of constant integers. The code in
> LegalizeDAG doesn't bother to legalize the
> mask, since it's basically just storage for
> a bunch of constants, however LegalizeTypes
> is more picky. The problem is that there may
> not exist any legal vector-of-integers type
> with a legal element type, so it is impossible
> to create a legal mask! Unless of course you
> cheat by creating a BUILD_VECTOR where the
> operands have a different type to the element
> type of the vector being built... This is
> pretty ugly but works - all relevant tests in
> the testsuite pass, and produce the same
> assembler with and without LegalizeTypes.
Yeah, this is horrible. :( The fix we eventually want to do is to
change VECTOR_SHUFFLE to be a variadic node where the shuffle mask is
a list of integer operands (operands #2..2+n) instead of a
BUILD_VECTOR. This means that you just have to pick a legal integer
type or use targetconstant nodes. Thanks for adding this to
legalizetypes!
-Chris
More information about the llvm-commits
mailing list