PATCH: SelectionDAG: Fix incorrect lowering of CONCAT_VECTOR

Tom Stellard tom at stellard.net
Thu Aug 7 07:57:14 PDT 2014


Hi,

SelectionDAGLegalize::ExpandVectorBuildThroughStack() was being
used to expand CONCAT_VECTORS, but it was assuming that its inputs
would only be BUILD_VECTOR nodes, so it was using the element type
of the input node to calculate the offsets for storing values to
the stack.  For example:
    
v16f32 = concat_vectors v8f32, v8f32

With this node, it would compute the offset as sizeof(f32),
so it would store the first operand at FrameIndex + 0 and the
second operand at FrameIndex + 4.  What it should be doing
for concat_vectors is using the value type of the operands
to compute the offset.  The second operand should be stored
at FrameIndex + sizeof(v8f32).
    
R600 currently hits this code path, however it should really be
be custom lowering CONCAT_VECTORS instead of expanding them since
this will produce much better code.  There are no testscase, because
no other in-tree targets seem to hit this path, and I don't think
there is much value in adding a test to R600, since I'm going
to modify it to custom lower CONCAT_VECTORS real soon.

-Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SelectionDAG-Fix-incorrect-lowering-of-CONCAT_VECTOR.patch
Type: text/x-diff
Size: 3448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140807/2642ff02/attachment.patch>


More information about the llvm-commits mailing list